1.1.2 • Published 4 years ago
@standardnotes/electron-secure-spellchecker v1.1.2
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 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThis 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-spellcheckerOr:
npm install @standardnotes/electron-secure-spellcheckerUsage
- Import the package into your
mainfile 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
preloadscript 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-devContributing
- 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).