Security News
Supply Chain Attack Detected in @solana/web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
cspell-lib
Advanced tools
cspell-lib
is the workhorse behind cspell. It does all the heavy lifting necessary to spell check files.
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
FAQs
A library of useful functions used across various cspell tools.
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.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.