Installation
You can install bun_nltk using your preferred JavaScript package manager. The package ships with prebuilt native binaries for supported platforms and a WASM runtime for universal compatibility.Install with package managers
Platform support
bun_nltk provides optimized builds for different platforms:Native binaries (fastest)
Prebuilt native binaries are included for:- Linux x64:
native/prebuilt/linux-x64/bun_nltk.so - Windows x64:
native/prebuilt/win32-x64/bun_nltk.dll
Native binaries provide the best performance, typically 3-10x faster than WASM on most operations.
WASM runtime (universal)
For platforms without native binaries, bun_nltk includes a WebAssembly build:- All platforms:
native/bun_nltk.wasm
- Universal compatibility across all platforms and runtimes
- Browser environment support
- Fallback for unsupported architectures (macOS, ARM, etc.)
- Still faster than pure JavaScript implementations
You can explicitly use the WASM runtime by importing from the
WasmNltk wrapper class, even on platforms with native binaries.Verify installation
After installation, verify that bun_nltk is working correctly:Environment variables
For advanced use cases, you can customize the native library path:- Local development with custom builds
- Testing new native implementations
- Deployment environments with specific binary requirements
Troubleshooting
Platform not supported
If you see an error about missing native libraries:- Use the WASM runtime (recommended):
- Build from source (advanced):
Import errors
If you encounter TypeScript import errors, ensure yourtsconfig.json includes:
Next steps
Quickstart
Learn the basics with a quick example
API reference
Explore all available functions