# spelledright

> This project is a js library used to facilitate spell checks on HTML pages

Latest version **1.0.0** (published 2016-03-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install spelledright
pnpm add spelledright
yarn add spelledright
bun add spelledright
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-03-16 |
| First published | 2016-03-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+16 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | tmillner |
| Keywords | js, spellcheck, spell-check, spelling, testing, checker, spelling, spell |

## Links

- npm: https://www.npmjs.com/package/spelledright
- npm.io page: https://npm.io/package/spelledright

## Dependencies (5)

- [xmldom](https://npm.io/package/xmldom.md) ^0.1.22
- [jasmine](https://npm.io/package/jasmine.md) ^2.4.1
- [typo-js](https://npm.io/package/typo-js.md) ^1.0.1
- [babel-cli](https://npm.io/package/babel-cli.md) ^6.5.1
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.5.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-03-16

## README

[![Coverage Status](https://coveralls.io/repos/github/tmillner/spelledright/badge.svg?branch=master)](https://coveralls.io/github/tmillner/spelledright?branch=master) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/tmillner/spelledright/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
## spelledright 

This project is a js library used to facilitate spell checks on XML, HTML pages in English. It wraps around [cfinke/Typo.js](https://github.com/cfinke/Typo.js). 
You can directly take the spelledright.js file and add it to your project.


#### The Mechanism
The way it works is by:

- 1) Parsing all children under a specified XML Node. 
- 2) Gathering all elements innertext 
- 3) Going throws the gat
hered innertext and (logically) breaking it up into words
- 4) Performing a spelling check on each word according to the desired options config

#### Example Usage 
```js
// 1) Load a page using a UI test driver ex.
// selenium-webdriver (https://www.npmjs.com/package/selenium-webdriver)
let driver = new webdriver.Builder().forBrowser('firefox').build();
driver.get(URL).then(() => {
  // 2) Get the target node to perform checks on the target children
  return driver.executeScript(`
    return document.getElementsByTagName('body')[0];
  `);
}).then(node => {
  // 3) Return the inner HTML (Library initialization as string node is supported)
  return node.getInnerHtml();
}).then(inner => {
  // 4) Use the library with your asserts, or logs
  let spelledright = new SpelledRight(inner, {
    ignoreCase: false,
    ignoreComments: true,
    whitelist: [/^[A-Z]+$/ /* All caps letters */]
  });
  console.log('Misspellings are: ' +
    JSON.stringify(spelledright.getMisspellings()));
  return driver.quit();
})
```
**Note** See the spec files for concrete examples.


#### Additional Usage
To run this project locally, or contribute:

- 1) `npm install` Make sure everything is installed.
- 2)`grunt babel` Convert es6 files to the js counterparts.
- 3) `npm run-script unittest && npm run-script perftest` Make sure tests are working.
- 4) `grunt watch` Anytime before developing. *Note: The project is linted extend from google.*
- 5) Develop!
- 6) Don't forget to add tests and test it out! Let's aim to keep coverage >= 93%
 Performance benchmarks should be roughly: 
  - DETAILED_PAGE_BENCHMARK: 1040.511ms
  - SIMPLE_PAGE_BENCHMARK: 752.908ms
- 7) `npm build` To ensure everything is in working order.
- 8) Now we're talking, make a PR upstream.

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