A simple client-side storage wrapper that uses localStorage with automatic fallback to cookies when localStorage is unavailable. Version 1.0.1 appears stable with infrequent updates. Differentiates from other storage libraries by its minimal API and use of a Node.js require-style module pattern, though it is designed exclusively for browsers, not Node.js. It supports basic get/set/remove operations but lacks advanced features like expiration, serialization, or namespacing.
npm install key-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic set, get, and remove operations in a browser environment.
Ensure code runs in a browser environment with localStorage or cookies available.
Use CommonJS require() or bundle with a bundler that can handle CJS.
Manually JSON.stringify() when setting and JSON.parse() when getting objects.
Be aware of cookie limitations; consider using a library with more robust fallback for large data.
Ensure the code runs in a browser environment; do not use in server-side Node.js.
Use const storage = require('key-storage'); instead of import.No dependency data recorded yet.