# Monaco spell checker

**URL:** https://discourse.nodered.org/t/monaco-spell-checker/99083
**Category:** General
**Tags:** monaco
**Created:** [17 September 2025 15:39 UTC](https://discourse.nodered.org/t/monaco-spell-checker/99083 "2025-09-17T15:39:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)
#### Post date: [17 September 2025 15:39 UTC](https://discourse.nodered.org/t/monaco-spell-checker/99083/1 "2025-09-17T15:39:10Z")

</div>

Hi There,

does anyone here have any idea how to add spellchecker functionality to the monaco editor in Node-RED?

I know that it might well be way off-topic for a editor that is used for code but I need it for documentation and for that it would be great to have a spell checker - even if its only the browser builtin spell checker.

I googled/duck-go'ed around the place and it seems that it's a non-trivial task to add spell checking to monaco in the first place but perhaps someone has done this anyway, perhaps for a closed source project and can't share the solution?

Any hints would be appreciate since it's a bearbug for a while now, i.e. I finally want a spellchecker! :-\

Cheers!

---

<div class="post-metadata">

### Author: ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)
#### Post date: [17 September 2025 17:18 UTC](https://discourse.nodered.org/t/monaco-spell-checker/99083/2 "2025-09-17T17:18:47Z")

</div>

I found this one in npm

> **[spellchecker-wasm](https://www.npmjs.com/package/spellchecker-wasm)**
>
> An extremely fast multi-thread capable Spellchecker written in Rust compiled to WebAssembly for Node.. Latest version: 0.3.3, last published: 5 years ago. Start using spellchecker-wasm in your project by running \`npm i spellchecker-wasm\`. There are 1...

You could try integrating it with monaco

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [17 September 2025 19:51 UTC](https://discourse.nodered.org/t/monaco-spell-checker/99083/3 "2025-09-17T19:51:05Z")

</div>

> **[monaco-spellchecker](https://www.npmjs.com/package/monaco-spellchecker)**
>
> A spellchecker for Monaco Editor. Latest version: 0.6.0, last published: 9 months ago. Start using monaco-spellchecker in your project by running \`npm i monaco-spellchecker\`. There are 2 other projects in the npm registry using monaco-spellchecker.

Haven't looked up how to add it though I'm afraid.

Brave's Leo AI gave me the following but could not tell me if it is possible to use this with Node-RED. 😃

* * *

To add a spell checker to the Monaco Editor, you can use the `monaco-spellchecker` library, which provides a straightforward approach for spellchecking words within the editor. First, install the required packages using npm:

```auto
npm install monaco-spellchecker
npm install typo-js

```

The `typo-js` library is needed to provide a dictionary for spellchecking, such as the English (US) dictionary. After installation, you can integrate the spell checker into your editor setup. Begin by creating a dictionary instance using the `Typo` class from `typo-js` and the dictionary files (`en_US.aff` and `en_US.dic` ).

```auto
import * as monaco from 'monaco-editor';
import Typo from 'typo-js';
import { getSpellchecker } from 'monaco-spellchecker';
import affData from 'typo-js/dictionaries/en_US/en_US.aff?raw';
import wordsData from 'typo-js/dictionaries/en_US/en_US.dic?raw';

const editor = monaco.editor.create(/* ...existing code... */);

// Create dictionary
const dictionary = new Typo("en_US", affData, wordsData);

// Get Spell Checker
const spellchecker = getSpellchecker(monaco, editor, {
  check: (word) => dictionary.check(word),
  suggest: (word) => dictionary.suggest(word),
  ignore: (word) => {
    console.log('Ignore word:', word);
  },
  addWord: (word) => {
    console.log('Add word:', word);
  }
});

// Process the editor content after it has been changed
const process = debounce(spellchecker.process, 500);
editor.onDidChangeModelContent(() => {
  process();
});

// Register code action provider
monaco.languages.registerCodeActionProvider('markdown', spellchecker.codeActionProvider);

```

The `getSpellchecker` function accepts the Monaco instance, the editor instance, and an options object that defines functions for checking spelling, suggesting corrections, and handling ignored or added words. The `process()` method re-scans the editor content for misspelled words, and `dispose()` cleans up the spellchecker when no longer needed. For better performance, especially with large documents, consider using `hunspell-asm` with a Web Worker instead of `typo-js` .

---

<div class="post-metadata">

### Author: ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)
#### Post date: [18 September 2025 06:55 UTC](https://discourse.nodered.org/t/monaco-spell-checker/99083/4 "2025-09-18T06:55:16Z")

</div>

I'll give it a try, it seems to be a sensible, straightforward solution! 😉

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [17 December 2025 06:56 UTC](https://discourse.nodered.org/t/monaco-spell-checker/99083/5 "2025-12-17T06:56:14Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
