Reusable caches, input validation, configuration, immutable snapshots, integer operations, asynchronous coordination and expression-parsing tools for TypeScript and JavaScript applications.
pnpm add @neutrium/utilities
# or: npm install @neutrium/utilities
This package is ESM only and requires Node.js 24 or later. Use a .mjs file or set
"type": "module" in your application's package.json. TypeScript declarations are
included; Node applications can use "module": "NodeNext" and
"moduleResolution": "NodeNext". Browser applications can use an ESM-aware bundler.
Browse the feature guides below. Each feature is available from its subpath and
the package root; for example, import caches from @neutrium/utilities/cache or
@neutrium/utilities.
| Feature | Subpath | Includes | Guide |
|---|---|---|---|
| Caching | @neutrium/utilities/cache |
LRU, weighted and budget caches; weak identity registries | Caching |
| Validation | @neutrium/utilities/validation |
Guards, assertions and safe data-record copying | Validation |
| Configuration | @neutrium/utilities/configuration |
Defined-value merging and validated configuration resolution | Configuration |
| Integer operations | @neutrium/utilities/integer |
BigInt integer helpers and 32-/64-bit word operations | Integer operations |
| Asynchronous coordination | @neutrium/utilities/async |
Serial operation queues and shared lazy initialization | Asynchronous operations |
| Immutable snapshots | @neutrium/utilities/immutable |
Deeply frozen snapshots of data graphs | Immutable snapshots |
| Parsing | @neutrium/utilities/parsing |
Pratt expression parsing, token cursors and parse errors | Parsing |
Numerical adapters now live in @neutrium/math. The migration guide covers dependency and import changes for version 5, plus the earlier adapter-contract changes for consumers upgrading from version 3 or earlier.
pnpm install
pnpm run verify
The API documentation and feature guides are generated with TypeDoc. Build them locally with pnpm run docs, then open docs/index.html. Generated files are ignored by Git and excluded from the npm package. pnpm run verify runs the package tests and builds the documentation, treating
documentation warnings as errors.
To build and preview the documentation locally:
pnpm run docs:dev
Open http://127.0.0.1:4173/utilities/.
After editing documentation, run pnpm run docs in another terminal and refresh
the browser. Stop the preview with Ctrl+C.
This project is licensed under the MIT License, see the LICENCE file for details.
You are free to:
Under the following conditions:
This plugin is provided "as is", without warranty of any kind. Use at your own risk.