1.1.2 • Published 2 years ago

@standardnotes/electron-secure-spellchecker v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

electron-secure-spellchecker

License: MIT

A spellchecker provider for Electron, that encrypts your dictionary file.

Why?

Electron uses the built-in spellchecker from Chromium. It stores custom dictionary words on a plain-text file named Custom dictionary.txt:

worda
wordb
checksum_v1 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

This package reads all words from such file (if any exists) and then encrypts them using Electron's safeStorage. The plain-text file is then deleted and the encrypted file is used to read/write words going forward.

Installation

Your Electron app must be using electron@15.3.0 or later.

To install, run:

yarn add @standardnotes/electron-secure-spellchecker

Or:

npm install @standardnotes/electron-secure-spellchecker

Usage

  1. Import the package into your main file and call setup() and getInstance():
import SecureSpellChecker from '@standardnotes/electron-secure-spellchecker';

...
SecureSpellChecker.setup();
...
const secureSpellChecker = SecureSpellChecker.getInstance();
  1. Use secureSpellChecker.getSpellingSuggestions() to obtain misspelt word suggestions:
...
const suggestions = secureSpellChecker.getSpellingSuggestions('ytpo');
  1. Import the package into your preload script and call setSpellCheckProvider()
import SecureSpellChecker from '@standardnotes/electron-secure-spellchecker';

...

SecureSpellChecker.setSpellCheckProvider();

You can also see usage on the test app

Notes

Needs libxkbfile-dev. You can install it by running the following (Linux):

sudo apt-get install libxkbfile-dev

Contributing

  1. Fork this repo
  2. Create your feature branch: git checkout -b feat/my-feature
  3. Code your feature
  4. Add your changes: git add .
  5. Commit your changes: git commit -am 'feat: my feature'
  6. Push the branch git push origin feat/my-feature
  7. Submit a pull request

License

See the LICENSE file for license rights and limitations (MIT).

1.1.1

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago