# spellcheck

> An async hunspell binding for node.js

Latest version **0.0.5** (published 2015-04-23) · 0 weekly downloads

## Install

```sh
npm install spellcheck
pnpm add spellcheck
yarn add spellcheck
bun add spellcheck
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2015-04-23 |
| First published | 2012-05-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.6.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 81 |
| Author | Brian White |
| Maintainers | mscdex |
| Keywords | spell, spellcheck, hunspell, spelling |

## Links

- npm: https://www.npmjs.com/package/spellcheck
- Repository: http://github.com/mscdex/spellcheck
- Homepage: https://github.com/mscdex/spellcheck
- Issues: https://github.com/mscdex/spellcheck/issues
- npm.io page: https://npm.io/package/spellcheck

## Dependencies (1)

- [nan](https://npm.io/package/nan.md) ^1.7.0

## Recent versions

- 0.0.5 (latest) — 2015-04-23
- 0.0.4 — 2013-08-22
- 0.0.3 — 2013-08-08
- 0.0.2 — 2013-03-29
- 0.0.1 — 2012-05-06

## README

Description
===========

An async hunspell binding for [node.js](http://nodejs.org/).


Requirements
============

* [node.js](http://nodejs.org/) -- v0.6.0 or newer
* [Dictionary and affix files](http://wiki.services.openoffice.org/wiki/Dictionaries)


Install
============

npm install spellcheck


Examples
========

* Check a word:
```javascript
  // this example uses the en_US hunspell files from SCOWL:
  //   http://wordlist.sourceforge.net/
  var SpellCheck = require('spellcheck'),
        base = __dirname + (process.platform === 'win32' ? '\\' : '/'),
        spell = new SpellCheck(base + 'en_US.aff', base + 'en_US.dic');

  spell.check('sain', function(err, correct, suggestions) {
      if (err) throw err;
      if (correct)
        console.log('Word is spelled correctly!');
      else
        console.log('Word not recognized. Suggestions: ' + suggestions);
  });

  // output:
  // Word not recognized. Suggestions: chain,sin,saint,satin,stain,slain,swain,rain,sail,lain,said,gain,main,spin,pain
```


API
===

Methods
-------

* **(constructor)**(<_String_>affixPath, <_Integer_>dictPath) - Creates and returns a new SpellCheck instance. affixPath is an **absolute** path that points to an affix (.aff) file. dictPath is an **absolute** path that points to a dictionary (.dic) file.

* **check**(<_String_>word, <_Function_>callback) - _(void)_ - Spell checks the given word. The callback receives three arguments: an <_Error_> object in case of error (null otherwise), a <_Boolean_> indicating if the word was spelled correctly, and if the word was not recognized, an <_Array_> of suggested words.

---
_Source: https://npm.io/package/spellcheck · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
