Node.js
Install the package from npm:onnxruntime-node, which is included as an optional dependency and will be installed automatically on supported platforms.
SQLite Storage (Optional)
For persistent PII map storage with SQLite:Bun
Bun requiresonnxruntime-web since onnxruntime-node is a native Node.js addon:
Browser (with Bundler)
When using Vite, webpack, esbuild, or other modern bundlers:Vite Configuration
No special configuration needed. Vite automatically resolves the browser build.Webpack Configuration
No special configuration needed. Webpack 5+ resolves conditional exports correctly.Browser (without Bundler)
For direct browser usage without a bundler:Conditional Exports
The package uses conditional exports to provide the right build for each environment:Explicit Imports
If needed, you can explicitly import a specific build:What’s Included
Browser Build Includes
- All recognizers (email, phone, IBAN, credit card, etc.)
- NER model support (with
onnxruntime-web) - Semantic enrichment
InMemoryPIIStorageProviderIndexedDBPIIStorageProvider- All crypto utilities
Browser Build Excludes
SQLitePIIStorageProvider(useIndexedDBPIIStorageProviderinstead)- Node.js
fs,path,osmodules
Requirements
| Environment | Version | Notes |
|---|---|---|
| Node.js | ≥ 18.0.0 | Uses native onnxruntime-node |
| Bun | ≥ 1.0.0 | Requires onnxruntime-web |
| Browsers | Chrome 86+, Firefox 89+, Safari 15.4+, Edge 86+ | Uses OPFS for model storage |