Isomorphic key-value storage library for JavaScript and TypeScript, supporting multiple backends including in-memory, localStorage, IndexedDB, and more. Current stable version is 3.2.0, with regular releases. It provides a unified API across Node.js, browsers, and other runtimes. Key differentiator: pluggable backend system and full TypeScript support out of the box, unlike simpler abstraction libraries.
npm install iso-kvNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a store with MemoryBlockstore backend, putting a block, and getting it back by CID.
Use Node.js >=16 and ensure your project is configured for ESM (type: module in package.json or use .mjs files).
Use 'fs' backend or a custom backend instead.
Always pass a backend instance to createStore().
Ensure you call createStore() and use the returned object. Example: const store = createStore({...}); await store.put(...);Convert to ESM imports. Use 'import' statements and ensure your package.json has 'type': 'module' or rename .js files to .mjs.
Check if get() returns a value before accessing .bytes. Example: const block = await store.get(cid); if (block) { console.log(block.bytes); }