{"name":"hunspell-reader","version":"10.3.3","keywords":["Hunspell"],"author":{"name":"Jason Dent"},"license":"MIT","_id":"hunspell-reader@10.3.3","maintainers":[{"name":"jason-dent","email":"jason@streetsidesoftware.nl"}],"homepage":"https://github.com/streetsidesoftware/cspell/tree/main/packages/hunspell-reader#readme","bugs":{"url":"https://github.com/streetsidesoftware/cspell/issues"},"bin":{"hunspell-reader":"bin.js"},"dist":{"shasum":"cdfcfd770ee74622c92380389971a54a95df97cf","tarball":"http://registry-npm.ywwl.com/hunspell-reader/download/hunspell-reader-10.3.3.tgz","fileCount":36,"integrity":"sha512-tm1C0RSxC2PY8i5ZO/Zn6kyJHu6Fb56ZHrO6RYrVyfvW1lFOhq4/nzz+DzZoskQ05kS5fRPULAGOtL50FF3p9g==","signatures":[{"sig":"MEUCIQCwZG7dPf8927Vf5LYOHSMvsyxYNFK+iNnwqiWi9xqvlAIgXlczQtQYdnFHbFvpbbuGoM2TuWbSTx0UFotKIay111I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/hunspell-reader@10.3.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":97907,"size":25561,"noattachment":false,"key":"/hunspell-reader/-/hunspell-reader-10.3.3.tgz"},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=22.18.0"},"exports":{".":{"import":"./dist/index.js"}},"gitHead":"e6e01b7294cca7174344b33639c05030100d1f4c","scripts":{"test":"pnpm run test-unit","build":"tsc -p .","clean":"shx rm -rf dist temp coverage \"*.tsbuildInfo\"","watch":"tsc -w","coverage":"vitest run --coverage","test-unit":"vitest run","smoke-test":"./bin.js words ./dictionaries/nl -n 100","test-spelling":"cspell \"src/**/*.ts\" \"*.md\""},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:97194243-8ccf-4ba4-97ec-44393dffab38"}},"repository":{"url":"git+https://github.com/streetsidesoftware/cspell.git","type":"git","directory":"packages/hunspell-reader"},"_npmVersion":"lerna/5.6.1/node@v24.20.0+x64 (linux)","description":"A library for reading Hunspell Dictionary Files","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"commander":"^15.0.0","iconv-lite":"^0.7.3","gensequence":"^8.0.8","html-entities":"^2.6.0","@cspell/cspell-pipe":"^10.3.3","@cspell/cspell-types":"^10.3.3"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/hunspell-reader_10.3.3_1789558427497_0.1822213651912996","host":"s3://npm-registry-packages-npm-production"},"readme":"# hunspell-reader\n\nA library for reading Hunspell Dictionary files\n\n## Application\n\nThis reader can be used as a tool for converting Hunspell files into a simple text file\nwith one word per line.\n\n### Installation\n\n```\nnpm install -g hunspell-reader\n```\n\n### Usage\n\nIt has basic command line help.\n\n```\nhunspell-reader words --help\n```\n\nOutputs:\n\n```\n\n  Usage: words [options] <hunspell_dic_file>\n\n  Output all the words in the <hunspell.dic> file.\n\n  Options:\n\n    -h, --help           output usage information\n    -o, --output <file>  output file - defaults to stdout\n    -s, --sort           sort the list of words\n    -u, --unique         make sure the words are unique.\n    -i, --ignore_case    used with --unique and --sort\n    -l, --lower_case     output in lower case\n    -T, --no-transform   Do not apply the prefix and suffix transforms.  Root words only.\n\n```\n\n### Converting Hunspell to word list\n\nTo convert a Hunspell dictionary to a word list, you will need both the `.dic` and `.aff` files.\nFor example en_US comes with two files: `en_US.dic` and `en_US.aff`.\nThis tool assumes they are both in the same directory.\n\nAssuming these files are in the current directory, the following command will write the words\nto `en_US.txt`.\n\n```\nhunspell-reader words ./en_US.dic -o en_US.txt\n```\n\n## Library Functions\n\n### Installation\n\n```\nnpm install hunspell-reader\n```\n\n### Usage\n\nTypescript / Javascript:\n\n<!--- @@inject: ./example-code/example.js --->\n\n```js\n// ts-check\nimport { HunspellReader } from 'hunspell-reader';\n\nconst baseFile = 'en_US';\nconst dicFile = baseFile + '.dic';\nconst affFile = baseFile + '.aff';\n\n// Initialize the reader with the Hunspell files\nconst reader = await HunspellReader.createFromFiles(affFile, dicFile);\n\n// Get the words as an array\nconst words = [...reader];\nconsole.log('%o', words);\n```\n\n<!--- @@inject-end: ./example-code/example.js --->\n\n## Reference\n\n- [Hunspell Docs](https://github.com/hunspell/hunspell/blob/master/man/hunspell.5)\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":1789558427619,"_cnpm_publish_time":1789558427619,"dist-tags":{"cspell5":"5.21.2","cspell5-next":"5.21.2-alpha.0","latest":"10.4.1","next":"10.4.0-alpha.1"}}