Yomguithereal / talisman

Straightforward fuzzy matching, information retrieval and NLP building blocks for JavaScript.
https://yomguithereal.github.io/talisman/
MIT License
704 stars 47 forks source link

Installation instructions incomplete #145

Open jonathanhaglund opened 6 years ago

jonathanhaglund commented 6 years ago

The installation instructions just say to execute "npm install talisman" but don't say what is necessary after that.

On Node 8.11, "const talisman = require('talisman')" throws "Error: cannot find module 'talisman'"

The usage documentation uses the "import" feature that is not yet supported on the current LTS, so some hints about how to get going would be greatly appreciated.

Yomguithereal commented 6 years ago

Just replace any import statement by a require, likewise:

import alphaSis from 'talisman/phonetics/alpha-sis';
// translates to
var alphaSis = require('talisman/phonetics/alpha-sis');
jonathanhaglund commented 6 years ago

I figured that out about 30 minutes ago, but I still recommend updating the Installation section of the readme to be something like (forgive any incorrect terms):

Install using "npm install talisman"

Note on ES6 Modules and "import": This project is written using ES6 modules. If your engine does not support this feature yet (i.e. Node 8.11 LTS), replace the import statements in the documentation with require ones.

import alphaSis from 'talisman/phonetics/alpha-sis'; // translates to var alphaSis = require('talisman/phonetics/alpha-sis');