
Security News
GitHub to Block pull_request_target Workflows by Default Starting December 2
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.
cspell-lib
Advanced tools
cspell-lib is the workhorse behind cspell. It does all the heavy lifting necessary to spell check files.
If our spell checkers save you time, please consider supporting their development.
Please show your support through one of the following sites:
npm i -S cspell-lib
Here is an example of using spellCheckDocument to spell check some text with a spelling issue.
import assert from 'node:assert';
import { spellCheckDocument } from 'cspell-lib';
// cspell:ignore wordz coztom clockz cuztom
const customWords = ['wordz', 'cuztom', 'clockz'];
async function checkSpelling(phrase: string) {
const result = await spellCheckDocument(
{ uri: 'text.txt', text: phrase, languageId: 'plaintext', locale: 'en' },
{ generateSuggestions: true, noConfigSearch: true },
{ words: customWords, suggestionsTimeout: 2000 }
);
return result.issues;
}
export async function run() {
console.log(`Start: ${new Date().toISOString()}`);
const r = await checkSpelling('These are my coztom wordz.');
console.log(`End: ${new Date().toISOString()}`);
// console.log(r);
assert(r.length === 1, 'Make sure we got 1 spelling issue back.');
assert(r[0].text === 'coztom');
assert(r[0].suggestions?.includes('cuztom'));
// console.log('%o', r);
}
import { resolve } from 'node:path';
import { pathToFileURL } from 'node:url';
import { spellCheckDocument } from 'cspell-lib';
export async function checkFile(filename: string) {
const uri = pathToFileURL(resolve(filename)).toString();
const result = await spellCheckDocument(
{ uri },
{ generateSuggestions: true, noConfigSearch: true },
{ words: customWords, suggestionsTimeout: 2000 }
);
return result.issues;
}
Available as part of the Tidelift Subscription.
The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. Learn more.
Brought to you by
Street Side Software
The spellchecker package provides a simple interface for spell checking text. It is less feature-rich compared to cspell-lib, focusing primarily on basic spell checking without the extensive customization options available in cspell-lib.
nodehun is a spell checker based on Hunspell dictionaries. It offers powerful spell checking capabilities similar to cspell-lib but requires Hunspell dictionaries to function. It is suitable for applications that need to support multiple languages with extensive dictionary support.
nspell is a spell checker that supports multiple languages and is based on Hunspell dictionaries. It is similar to cspell-lib in terms of functionality but focuses more on providing a lightweight and fast spell checking solution with support for various languages.
FAQs
A library of useful functions used across various cspell tools.
The npm package cspell-lib receives a total of 1,436,086 weekly downloads. As such, cspell-lib popularity was classified as popular.
We found that cspell-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.

Security News
/Application Security
A practical guide to securing GitHub Actions against supply chain attacks, covering malicious pull requests, credential theft, dependency risks, and release pipelines.

Security News
Composer 2.11 adds dependency cooldowns, joining package managers that delay new releases to reduce supply chain risks while allowing urgent security updates.