MongoDB-inspired utility for constructing IndexedDB key ranges (IDBKeyRange) with a concise object notation. Version 3.1.3 is stable, with no active development since 2017. It simplifies range creation by accepting an object with gt/lt/gte/lte/eq properties or a plain value, reducing boilerplate over native IDBKeyRange methods. Lightweight, no dependencies, ESM-only, primarily for browser environments using IndexedDB.
npm install idb-rangeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and use the default export to create an IDBKeyRange for a cursor query.
Avoid passing IDBKeyRange instances; always use plain objects or values.
Check for null before using in IndexedDB calls, or always provide valid parameters.
Consider using native IDBKeyRange directly or an alternative active library.
Use `import range from 'idb-range'` (no braces).
Run `npm install idb-range` and ensure `"type": "module"` in package.json or use .mjs extension.
Use `import range from 'idb-range'` or enable dynamic import: `const range = (await import('idb-range')).default`.No dependency data recorded yet.