This is a simple command-line tool for spell-checking text files (based on core-text-spellcheck).
Install with: npm install --global core-text-spellcheck-cli
Run core-text-spellcheck
for help.
This can also be used as a library for making command-line spell-checkers.
#!/usr/bin/env node
'use strict'
require('core-text-spellcheck-cli')({
spellCheckerInit: (options) => require('core-text-spellcheck')(options),
spellCheckerCall: (spellChecker, content) => spellChecker(content)
})()
spellCheckerInit(options)
—function taking a single parameter, an "options" object. This object should be passed to the spell-checking wrapper you are using, which must support the same options as core-text-spellcheck. Returns: your chosen spell-checker, initialised.spellCheckerCall(spellChecker, content)
—function that takes the initialisedspellChecker
and the content to be checked, and calls the spell-checker with the content to be checked. This is useful when your spell-checker might not just be a simple function, but an object with a method that is used to perform the spell-check.
usageMessage
(string)—extra usage info to include in the help output.preProcessor
(function taking one argument)—function to run on the file's content before it is spell-checked.
- Check out the code.
npm install
npm test
—lints the code (which also happens on pre-commit).