# @standardnotes/electron-secure-spellchecker

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

Latest version **1.1.2** (published 2022-03-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @standardnotes/electron-secure-spellchecker
pnpm add @standardnotes/electron-secure-spellchecker
yarn add @standardnotes/electron-secure-spellchecker
bun add @standardnotes/electron-secure-spellchecker
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-03-22 |
| First published | 2022-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Johnny Almonte |
| Maintainers | vardan-sn, aman-sn, sn_mo, karolsojko, sn-johnny |
| Keywords | electron, secure, dictionary, spellchecker |

## Links

- npm: https://www.npmjs.com/package/@standardnotes/electron-secure-spellchecker
- Repository: https://github.com/standardnotes/secure-utils
- Homepage: https://github.com/standardnotes/secure-utils/electron-secure-spellchecker#readme
- Issues: https://github.com/standardnotes/secure-utils/issues
- npm.io page: https://npm.io/package/@standardnotes/electron-secure-spellchecker

## Recent versions

- 1.1.2 (latest) — 2022-03-22
- 1.1.1 — 2022-03-16
- 1.1.0 — 2022-03-10
- 1.0.3 — 2022-02-13
- 1.0.2 — 2022-02-12
- 1.0.1 — 2022-02-10
- 1.0.0 — 2022-02-10

## README

# electron-secure-spellchecker

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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`:

```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](https://www.electronjs.org/docs/latest/api/safe-storage). 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:

```bash
yarn add @standardnotes/electron-secure-spellchecker
```

Or:

```bash
npm install @standardnotes/electron-secure-spellchecker
```

## Usage

1. Import the package into your `main` file and call `setup()` and `getInstance()`:

```javascript
import SecureSpellChecker from '@standardnotes/electron-secure-spellchecker';

...
SecureSpellChecker.setup();
...
const secureSpellChecker = SecureSpellChecker.getInstance();
```

1. Use `secureSpellChecker.getSpellingSuggestions()` to obtain misspelt word suggestions:

```javascript
...
const suggestions = secureSpellChecker.getSpellingSuggestions('ytpo');
```

1. Import the package into your `preload` script and call `setSpellCheckProvider()`

```javascript
import SecureSpellChecker from '@standardnotes/electron-secure-spellchecker';

...

SecureSpellChecker.setSpellCheckProvider();
```

---

You can also see usage on [the test app](test/electron-app/)

## Notes

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

```bash
sudo apt-get install libxkbfile-dev
```

## Contributing

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

## License

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

---
_Source: https://npm.io/package/@standardnotes/electron-secure-spellchecker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
