# typo-js

> A Hunspell-style spellchecker.

Latest version **1.3.2** (published 2026-05-12) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install typo-js
pnpm add typo-js
yarn add typo-js
bun add typo-js
```

## Health

**Score 48/100 (D)** — status: active.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2026-05-12 |
| First published | 2016-01-01 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | separate (@types/typo-js) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 557 |
| Author | Christopher Finke |
| Maintainers | cfinke |
| Keywords | spellcheck, spellchecker, hunspell, typo, speling |

## Links

- npm: https://www.npmjs.com/package/typo-js
- Repository: https://github.com/cfinke/Typo.js
- Homepage: https://github.com/cfinke/Typo.js#readme
- Issues: https://github.com/cfinke/Typo.js/issues
- npm.io page: https://npm.io/package/typo-js

## Recent versions

- 1.3.2 (latest) — 2026-05-12
- 1.3.1 — 2025-08-14
- 1.3.0 — 2025-07-31
- 1.2.5 — 2024-12-16
- 1.2.4 — 2024-02-12
- 1.2.3 — 2023-06-04
- 1.2.2 — 2022-08-01
- 1.2.1 — 2021-10-19
- 1.2.0 — 2020-12-09
- 1.1.0 — 2019-12-07
- 1.0.3 — 2017-01-15
- 1.0.2 — 2016-11-25
- 1.0.1 — 2016-01-01
- 1.0.0 — 2016-01-01

## README

Typo.js is a JavaScript/TypeScript spellchecker that uses Hunspell-style dictionaries.

Usage
=====

To use Typo, simply load it like so:

```javascript
var Typo = require("typo-js");
var dictionary = new Typo(lang_code);
```

Typo includes by default a dictionary for the `en_US` lang_code.

To check if a word is spelled correctly, do this:

```javascript
var is_spelled_correctly = dictionary.check("mispelled");
```

To get suggested corrections for a misspelled word, do this:

```javascript
var array_of_suggestions = dictionary.suggest("mispeling");

// array_of_suggestions == ["misspelling", "dispelling", "misdealing", "misfiling", "misruling"]
```

Typo.js has full support for the following Hunspell affix flags:

* `PFX`
* `SFX`
* `REP`
* `FLAG`
* `COMPOUNDMIN`
* `COMPOUNDRULE`
* `ONLYINCOMPOUND`
* `KEEPCASE`
* `NOSUGGEST`
* `NEEDAFFIX`

It also supports the Typo-specific flag `PRIORITYSUGGEST`. This allows you to specify that certain words should be given priority in the suggestions list when correcting a mispelled word. If you add the following to your `.aff` file (ideally on the line after NOSUGGEST):

```
PRIORITYSUGGEST @
```

and then add the `@` flag to your new words in your `.dic` file, like

```
skibidi/@
rizz/@
```

then those words will be prioritized above other suggestions if they already appear in the suggestions list.

Development
===========
The full TypeScript source code and unit test suites are available in the official Typo.js repository at https://github.com/cfinke/Typo.js

To modify Typo.js, make your changes to `ts/typo.ts` and then run `build.sh` to generate the JavaScript file `typo/typo.js`.

Licensing
=========

Typo.js is free software, licensed under the Modified BSD License.

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