{"name":"cspell-lib","version":"5.6.6","keywords":["spell","checker","code","camel","case","spelling","spell checker","spelling checker","lint"],"author":{"name":"Jason Dent"},"license":"MIT","_id":"cspell-lib@5.6.6","homepage":"https://github.com/streetsidesoftware/cspell#readme","bugs":{"url":"https://github.com/streetsidesoftware/cspell/labels/cspell-lib"},"dist":{"shasum":"241924d83d9df9714692946246afe37c9074a79b","tarball":"http://registry-npm.ywwl.com/cspell-lib/download/cspell-lib-5.6.6.tgz","fileCount":107,"integrity":"sha512-Sum4U7/xWTJm99DeZF0bFBBN5SQ7roArlwnnKMmuRRcYl3s9/3OgtIK2YOOgqoSCxh4G51f7aal+bNAlAnx1bA==","signatures":[{"sig":"MEUCIQDrytit1Vkuac2n2CMk19NAxTCV03WUeC8sx4J+8a5XVwIgHy/K+Nv/nFdz00GCF9blGrVfhI2luCxmtylsS8V0/fc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":232390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzSXlCRA9TVsSAnZWagAAqVcQAJVj4xpuVERot30t3BUN\nKYCiId7N6GFgxGu/wIUKbRNuFD/y5FhIPJ+ku8S7W/hha2bmR2jobVKmhA8k\nWZKJY0CCMZQ55K4bE/CZ8Rf/0yYpDiXXp/NJwksj+Jp3kYAdXWff1bz7SGUb\nPrXMHTCAj0Xq9w/xa+H4akROOgEZ2D4dnoGvWC2c/G3vOU11VuDbzO15hjZh\n0x8d8R2fXptwybTOctG55p+mC3LvnzocbD5/tBCWj5+4Izu8VY0tvuJXcRxq\njuCj0KqSawzGnbm4jYa0BVAzXWuaK8df8YLn9bEuLsUGJXgN967hZPsfER1t\nUFoxBIO5SwRkOUgSNDZemtJyxxtxRZZcIloXqucYAOU34EKFFPu7I0ef+GJv\nB0guR/fMqbDb7o/pxF1Kh83dLD+8RbazO0fxHyqGpLCwSDVYbZYviuTQyOX2\n/M0D4R5UGFTOffIGQUiUFq+y8HZM/ySEOX5j2Mz5xvGkJAIzTqFJtYXE5VLn\n/TZeUkUiL6z4RTtXqDK+nkz9gFJwOXrvHA86xV8cO8Yda0Ew8y6/BVwWw0hF\nHpD/cIxjzqKgM804/9ae6CU6qHnF+alc2BiopM+I9xvfW5STUHLHbQ8gk0c3\n/z2+bZPJ4QukXlz5wXvjhYkPe2bF1yOlMhd07im6q94z2xnnbhOeSou78aOe\nnN3A\r\n=vGKc\r\n-----END PGP SIGNATURE-----\r\n","size":53178,"noattachment":false,"key":"/cspell-lib/-/cspell-lib-5.6.6.tgz"},"main":"dist/index.js","engines":{"node":">=12.0.0"},"gitHead":"12386cd24cb7e7050734ec6fc48ea90a472d341b","scripts":{"test":"jest","build":"npm run compile","clean":"rimraf dist temp coverage","watch":"tsc --watch -p .","compile":"tsc -p .","coverage":"jest --coverage","test-watch":"jest --watch","clean-build":"npm run clean && npm run build","prepublishOnly":"npm run clean-build && npm test","update-snapshot":"jest --updateSnapshot"},"typings":"dist/index.d.ts","_npmUser":{"name":"jason-dent","email":"jason@streetsidesoftware.nl"},"repository":{"url":"git+https://github.com/streetsidesoftware/cspell.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (darwin)","description":"A library of useful functions used across various cspell tools.","directories":{},"_nodeVersion":"14.17.0","dependencies":{"find-up":"^5.0.0","fs-extra":"^10.0.0","cspell-io":"^5.6.5","vscode-uri":"^3.0.2","configstore":"^5.0.1","cosmiconfig":"^7.0.0","cspell-glob":"^5.6.5","gensequence":"^3.1.1","clear-module":"^4.1.1","comment-json":"^4.1.0","import-fresh":"^3.3.0","resolve-from":"^5.0.0","resolve-global":"^1.0.0","cspell-trie-lib":"^5.6.5","@cspell/cspell-types":"^5.6.5","@cspell/cspell-bundled-dicts":"^5.6.6"},"files:comment":"Due to a lerna bug, patterns like `!**/*.map` are not getting recursively honored","_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","rimraf":"^3.0.2","@types/node":"^15.12.4","lorem-ipsum":"^2.0.3","@types/fs-extra":"^9.0.11","@cspell/dict-cpp":"^1.1.39","@cspell/dict-css":"^1.0.11","@cspell/dict-html":"^1.1.7","cspell-dict-nl-nl":"^1.1.2","@cspell/dict-fa-ir":"^1.0.17","@cspell/dict-fr-fr":"^1.2.21","@cspell/dict-nl-nl":"^1.0.35","@types/configstore":"^5.0.0","@cspell/dict-csharp":"^1.0.11","@cspell/dict-python":"^1.0.35"},"_npmOperationalInternal":{"tmp":"tmp/cspell-lib_5.6.6_1624057317461_0.523831540152061","host":"s3://npm-registry-packages"},"readme":"# CSpell Library\n\n`cspell-lib` is the workhorse behind cspell. It does all the heavy lifting necessary to spell check files.\n\n## Support Future Development\n\n<!--- @@inject: ../../static/sponsor.md --->\n\n- [![GitHub Sponsors](https://img.shields.io/badge/-black?style=social&logo=githubsponsors&label=GitHub%20Sponsor%3A%20Street%20Side%20Software)](https://github.com/sponsors/streetsidesoftware)\n- [![Patreon](https://img.shields.io/badge/-black?style=social&logo=patreon&label=Patreon%3A%20Street%20Side%20Software)](https://patreon.com/streetsidesoftware)\n- [![PayPal](https://img.shields.io/badge/-black?style=social&logo=paypal&label=PayPal%20Donate%3A%20Street%20Side%20Software)](https://www.paypal.com/donate/?hosted_button_id=26LNBP2Q6MKCY)\n- [![Open Collective](https://img.shields.io/badge/-black?style=social&logo=opencollective&label=Open%20Collective%3A%20CSpell)](https://opencollective.com/cspell)\n\n<!--- @@inject-end: ../../static/sponsor.md --->\n\n## Installation\n\n```\nnpm i -S cspell-lib\n```\n\n## Usage\n\n### Example - Check some text\n\nHere is an example of using `spellCheckDocument` to spell check some text with a spelling issue.\n\n```ts\nimport assert from 'node:assert';\n\nimport { spellCheckDocument } from 'cspell-lib';\n\n// cspell:ignore wordz coztom clockz cuztom\nconst customWords = ['wordz', 'cuztom', 'clockz'];\n\nasync function checkSpelling(phrase: string) {\n  const result = await spellCheckDocument(\n    { uri: 'text.txt', text: phrase, languageId: 'plaintext', locale: 'en' },\n    { generateSuggestions: true, noConfigSearch: true },\n    { words: customWords, suggestionsTimeout: 2000 }\n  );\n  return result.issues;\n}\n\nexport async function run() {\n  console.log(`Start: ${new Date().toISOString()}`);\n  const r = await checkSpelling('These are my coztom wordz.');\n  console.log(`End: ${new Date().toISOString()}`);\n  // console.log(r);\n  assert(r.length === 1, 'Make sure we got 1 spelling issue back.');\n  assert(r[0].text === 'coztom');\n  assert(r[0].suggestions?.includes('cuztom'));\n  // console.log('%o', r);\n}\n```\n\n### Example - Check a file\n\n```ts\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { spellCheckDocument } from 'cspell-lib';\n\nexport async function checkFile(filename: string) {\n  const uri = pathToFileURL(resolve(filename)).toString();\n  const result = await spellCheckDocument(\n    { uri },\n    { generateSuggestions: true, noConfigSearch: true },\n    { words: customWords, suggestionsTimeout: 2000 }\n  );\n  return result.issues;\n}\n```\n\n## CSpell for Enterprise\n\n<!--- @@inject: ../../static/tidelift.md --->\n\nAvailable as part of the Tidelift Subscription.\n\nThe 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.](https://tidelift.com/subscription/pkg/npm-cspell?utm_source=npm-cspell&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n\n<!--- @@inject-end: ../../static/tidelift.md --->\n\n<!--- @@inject: ../../static/footer.md --->\n\n<br/>\n\n---\n\n<p align=\"center\">Brought to you by<a href=\"https://streetsidesoftware.com\" title=\"Street Side Software\"><img width=\"16\" alt=\"Street Side Software Logo\" src=\"https://i.imgur.com/CyduuVY.png\" /> Street Side Software</a></p>\n\n<!--- @@inject-end: ../../static/footer.md --->\n","publish_time":1624057317604,"maintainers":[{"name":"jason-dent","email":"jason@streetsidesoftware.nl"}],"_cnpm_publish_time":1624057317604,"dist-tags":{"cspell4":"4.3.12","cspell5":"5.21.2","cspell5-next":"5.21.2-alpha.0","latest":"10.4.0","next":"10.4.0-alpha.1"}}