ogdens-word-list checks text against Ogden's Basic English word list so you can quickly spot words that may reduce readability.
The library exposes two functions:
check(text): returns words not found in the Basic English list (case-insensitive matching for known words).highlight(text): returns HTML with non-matching words wrapped in an underline<span>.
npm install ogdens-word-listconst enBasic = require('ogdens-word-list');
const text = 'cat kubernetes dog';
const unsupported = enBasic.check(text);
console.log(unsupported); // ["kubernetes"]
console.log(enBasic.highlight(text));
// cat <span style="text-decoration: underline;">kubernetes</span> dogBrowser usage is still supported with the bundled script:
<script src="en-basic.js"></script>
<script>
console.log(enBasic.check('cat kubernetes dog'));
</script>npm run lint: run Biome lint checks.npm run lint:fix: apply Biome lint fixes where possible.npm run format: format supported files with Biome.npm test: run Jest tests.npm run test:coverage: run Jest with coverage thresholds.npm run prepare: enable git hooks with Husky.
- Install dependencies with
npm install. - Enable hooks with
npm run prepare. - Make changes.
- Run
npm run lintandnpm testbefore pushing.
This repository uses Commitlint with conventional commit rules.
- Hook file:
.husky/commit-msg - To enable locally after clone:
npm run prepare
Releases are managed with Release Please + automated npm publish via GitHub Actions:
- Merge conventional commits into
mainormaster. - Release Please opens/updates a release PR with version and changelog updates.
- Merge the release PR to create a GitHub release.
- On release publish,
.github/workflows/publish.ymlruns lint/tests and publishes to npm.
To enable publishing, set the
NPM_TOKENrepository secret.