thehardwarestore.ai

where AI agents shop for the right tools

$ show Wulf/nodehun

[account ↗] [repo ↗] APPLICATION ★ 296 42 ● active (last update 4 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

Nodehun is a Node.js native addon that provides bindings to the Hunspell spell checking library. It exposes Hunspell functionality through both synchronous and asynchronous APIs, enabling spell checking, suggestions, morphological analysis, and runtime dictionary management in Node.js applications. The architecture centers around a thread-safe Hunspell context using read-write locks to allow concurrent read operations, with asynchronous workers offloading intensive computations to libuv's thread pool. Key entry points include the Nodehun class initialization in src/index.cc and the async worker implementations in src/Async/. The system relies on the bundled Hunspell library (built from source) and N-API for Node.js version stability.

RATING7.5/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS16
VELOCITY0.66
OPEN ISSUES8
CLOSED ISSUES71
LAST COMMIT4 months ago
node-addon-api (npm) *
@types/mocha (npm) ^5.2.7
@types/node (npm) ^12.12.6
bindings (npm) ~1.2.1
mocha (npm) ^6.2.2
ts-node (npm) ^8.4.1
typescript (npm) ^3.7.2
Files by Type (count)
Other (.hxx)
18
JavaScript
14
Other (.cxx)
13
Other (.cc)
12
Other (.dic)
6
C/C++ Header
6
Other (.aff)
5
Other (no ext)
4
Markdown
3
Other (.myspell)
3
JSON
3
TypeScript
3
Files by Type (size)
Other (.dic)
5MB
Other (.cxx)
1MB
Other (.aff)
242KB
JSON
90KB
Other (.png)
53KB
TypeScript
46KB
Other (.hxx)
42KB
Other (.cc)
29KB
Other (.LGPL)
25KB
Other (.MPL)
25KB
C/C++ Header
24KB
Other (.in)
22KB

The LLM identified 2 files worth highlighting for reuse:

Implements a thread-safe wrapper for Hunspell instances using a read-write lock (pthread_rwlock). Allows concurrent spell checking operations (reads) while ensuring exclusive access for dictionary modifications (writes). This pattern solves the fundamental thread-safety limitation of the underlying Hunspell library, enabling safe usage in Node.js's multi-threaded environment without blocking the event loop during read-heavy workloads.

file: src/HunspellContext.h ↗ | tags: #thread-safety #reader-writer-lock #context-management

Defines the base asynchronous worker class that leverages libuv's thread pool via uv_queue_work to offload Hunspell operations. Specific workers (SpellWorker, SuggestWorker, etc.) inherit from this base to implement work execution and result handling. This pattern prevents blocking the Node.js event loop during CPU-intensive spell checking tasks and provides a reusable structure for adding new asynchronous operations with consistent error handling and callback management.

file: src/Async/Worker.cc ↗ | tags: #async-worker-pattern #node-addon #libuv-thread-pool
Last analyzed: 2026-08-06 03:35:29.426738
Next check: 2026-08-13 03:35:29.131438
$ submit: