Nittro/Storage is a client-side storage abstraction library for web applications, part of the Nittro framework. Version 2.0.2 provides a unified API for localStorage, sessionStorage, and custom storage backends with automatic JSON serialization and expiration support. It uses ES modules and TypeScript definitions. Compared to raw Web Storage API, it adds type safety (when used with TypeScript), fallback mechanisms for private browsing, and a consistent interface across storage types. The package is passively maintained with no recent updates; it depends on the Nittro DI container
npm install nittro-extras-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating LocalStorage and SessionStorage instances with prefix, CRUD operations, and custom backend usage.
Always use the provided Storage methods instead of direct localStorage access for prefixed keys.
Use LocalStorage.createWithExpiration(options) or set the expiration parameter individually.
Use ES module imports (import { ... } from 'nittro-extras-storage') or enable ESM in your project.Use setItemWithExpiration(key, value, ttl) instead.
Wrap creation in a try-catch or check for availability using Storage.isSupported() before usage.
Only store JSON-serializable values (strings, numbers, booleans, plain objects, arrays).
Ensure the package runs in a browser environment where localStorage is globally available. For Node.js, use a polyfill.
Use import { Storage } from 'nittro-extras-storage'.Run npm install nittro-extras-storage. If using pnpm, ensure your .npmrc is correct.
Bind the method: const getItem = storage.getItem.bind(storage); or use arrow function: (key) => storage.getItem(key).
Create storage via LocalStorage.create() or SessionStorage.create().
No dependency data recorded yet.