@standardnotes/electron-secure-spellchecker
v1.1.2
Published
A spellchecker provider for Electron, that encrypts your dictionary file.
Downloads
11
Readme
electron-secure-spellchecker
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 [email protected]
or later.
To install, run:
yarn add @standardnotes/electron-secure-spellchecker
Or:
npm install @standardnotes/electron-secure-spellchecker
Usage
- Import the package into your
main
file and callsetup()
andgetInstance()
:
import SecureSpellChecker from '@standardnotes/electron-secure-spellchecker';
...
SecureSpellChecker.setup();
...
const secureSpellChecker = SecureSpellChecker.getInstance();
- Use
secureSpellChecker.getSpellingSuggestions()
to obtain misspelt word suggestions:
...
const suggestions = secureSpellChecker.getSpellingSuggestions('ytpo');
- Import the package into your
preload
script and callsetSpellCheckProvider()
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
- Fork this repo
- Create your feature branch:
git checkout -b feat/my-feature
- Code your feature
- Add your changes:
git add .
- Commit your changes:
git commit -am 'feat: my feature'
- Push the branch
git push origin feat/my-feature
- Submit a pull request
License
See the LICENSE file for license rights and limitations (MIT).