Global data storage manager for Node.js. Current version is 3.0.1, released with full TypeScript support, ESModules compatibility, zero dependencies, and 100% test coverage. Provides a simple key-value store with metadata, protection, and default options. Unlike other global state solutions, it wraps the storage in an abstraction layer with TypeScript generics, metadata tracking, and protection flags. The API is minimal and focused on global variable management without external dependencies. Maintained by jhereu with active releases.
npm install node-global-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: set, get, check, unset, flush, and options with TypeScript generics. Shows common operations.
Review the new API docs. The setDefaultOption method replaces previous option configuration. Type parameters may be required now.
Migrate to 3.x using the new method names: setValue, getValue, etc.
Use setValue<string>('key', 'value') or setValue('key', 'value') TypeScript will infer if the value matches.Use isSet(key) to check before calling getValue, or handle potential undefined.
Use flush({ onlyUnprotected: true }) instead of flush({ filter: ... }) if migrating from 2.x.Ensure TypeScript is configured correctly. Package has built-in types. No need for separate @types package. Try reinstalling: npm install --save node-global-storage
Change import statement to: import { setValue } from 'node-global-storage'Use import syntax: import { getValue } from 'node-global-storage' or switch to CommonJS.Use named import: import { setValue } from 'node-global-storage'No dependency data recorded yet.