{"id":13431777,"url":"https://github.com/jakearchibald/idb-keyval","last_synced_at":"2026-10-19T01:04:16.264Z","repository":{"id":37431029,"uuid":"65473442","full_name":"jakearchibald/idb-keyval","owner":"jakearchibald","description":"A super-simple-small promise-based keyval store implemented with IndexedDB","archived":false,"fork":false,"pushed_at":"2026-07-08T10:34:33.000Z","size":535,"stargazers_count":3252,"open_issues_count":25,"forks_count":150,"subscribers_count":21,"default_branch":"main","last_synced_at":"2026-10-15T18:01:05.208Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakearchibald.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2016-08-11T13:53:46.000Z","updated_at":"2026-10-13T12:08:33.000Z","dependencies_parsed_at":"2023-12-12T00:21:03.524Z","dependency_job_id":"ce96ba8e-4d9b-4cda-bdff-e89661c8695e","html_url":"https://github.com/jakearchibald/idb-keyval","commit_stats":{"total_commits":105,"total_committers":23,"mean_commits":4.565217391304348,"dds":0.2666666666666667,"last_synced_commit":"6695b178d3e1a6a6252d6d72bf8b1830253aadc1"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/jakearchibald/idb-keyval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakearchibald%2Fidb-keyval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakearchibald%2Fidb-keyval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakearchibald%2Fidb-keyval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakearchibald%2Fidb-keyval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakearchibald","download_url":"https://codeload.github.com/jakearchibald/idb-keyval/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakearchibald%2Fidb-keyval/sbom","scorecard":{"id":502461,"data":{"date":"2025-08-11","repo":{"name":"github.com/jakearchibald/idb-keyval","commit":"9d19315b4a83897df1e0193dccdc29f78466a0f3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 4/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":1,"reason":"0 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T22:18:38.033Z","repository_id":37431029,"created_at":"2025-08-19T22:18:38.033Z","updated_at":"2025-08-19T22:18:38.033Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344836268,"owners_count":38330120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-15T02:00:06.843Z","response_time":105,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:05.798Z","updated_at":"2026-10-19T01:04:16.255Z","avatar_url":"https://github.com/jakearchibald.png","language":"TypeScript","funding_links":[],"categories":["JavaScript","TypeScript","Packages"],"sub_categories":[],"readme":"# IDB-Keyval\n\n[![npm](https://img.shields.io/npm/v/idb-keyval.svg)](https://www.npmjs.com/package/idb-keyval)\n\nThis is a super-simple promise-based keyval store implemented with IndexedDB, originally based on [async-storage by Mozilla](https://github.com/mozilla-b2g/gaia/blob/master/shared/js/async_storage.js).\n\nIt's small and tree-shakeable. If you only use get/set, the library is 295 bytes (brotli'd), if you use all methods it's 573 bytes.\n\n[localForage](https://github.com/localForage/localForage) offers similar functionality, but supports older browsers with broken/absent IDB implementations. Because of that, it's orders of magnitude bigger (~7k).\n\nThis is only a keyval store. If you need to do more complex things like iteration \u0026 indexing, check out [IDB on NPM](https://www.npmjs.com/package/idb) (a little heavier at 1k). The first example in its README is how to create a keyval store.\n\n## Installing\n\n### Recommended: Via npm + webpack/rollup/parcel/etc\n\n```sh\nnpm install idb-keyval\n```\n\nNow you can require/import `idb-keyval`:\n\n```js\nimport { get, set } from 'idb-keyval';\n```\n\nIf you're targeting IE10/11, use the compat version, and import a `Promise` polyfill.\n\n```js\n// Import a Promise polyfill\nimport 'es6-promise/auto';\nimport { get, set } from 'idb-keyval/compat';\n```\n\n### All bundles\n\nA well-behaved bundler should automatically pick the ES module or the CJS module depending on what it supports, but if you need to force it either way:\n\n- `idb-keyval/dist/index.js` EcmaScript module.\n- `idb-keyval/dist/index.cjs` CommonJS module.\n\nLegacy builds:\n\n- `idb-keyval/compat` transpiled for older browsers; a well-behaved bundler will pick the ES module or CJS module as appropriate.\n- `idb-keyval/umd` UMD module, transpiled for older browsers; a well-behaved bundler will pick the appropriate module.\n- `idb-keyval/dist/compat.js` EcmaScript module, transpiled for older browsers.\n- `idb-keyval/dist/compat.cjs` CommonJS module, transpiled for older browsers.\n- `idb-keyval/dist/umd.js` UMD module, also transpiled for older browsers.\n\nThese built versions are also available on jsDelivr, e.g.:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/idb-keyval@6/dist/umd.js\"\u003e\u003c/script\u003e\n\u003c!-- Or in modern browsers: --\u003e\n\u003cscript type=\"module\"\u003e\n  import { get, set } from 'https://cdn.jsdelivr.net/npm/idb-keyval@6/+esm';\n\u003c/script\u003e\n```\n\n## Usage\n\n### set:\n\n```js\nimport { set } from 'idb-keyval';\n\nset('hello', 'world');\n```\n\nSince this is IDB-backed, you can store anything structured-clonable (numbers, arrays, objects, dates, blobs etc), although old Edge doesn't support `null`. Keys can be numbers, strings, `Date`s, (IDB also allows arrays of those values, but IE doesn't support it).\n\nAll methods return promises:\n\n```js\nimport { set } from 'idb-keyval';\n\nset('hello', 'world')\n  .then(() =\u003e console.log('It worked!'))\n  .catch((err) =\u003e console.log('It failed!', err));\n```\n\n### get:\n\n```js\nimport { get } from 'idb-keyval';\n\n// logs: \"world\"\nget('hello').then((val) =\u003e console.log(val));\n```\n\nIf there is no 'hello' key, then `val` will be `undefined`.\n\n### setMany:\n\nSet many keyval pairs at once. This is faster than calling `set` multiple times.\n\n```js\nimport { set, setMany } from 'idb-keyval';\n\n// Instead of:\nPromise.all([set(123, 456), set('hello', 'world')])\n  .then(() =\u003e console.log('It worked!'))\n  .catch((err) =\u003e console.log('It failed!', err));\n\n// It's faster to do:\nsetMany([\n  [123, 456],\n  ['hello', 'world'],\n])\n  .then(() =\u003e console.log('It worked!'))\n  .catch((err) =\u003e console.log('It failed!', err));\n```\n\nThis operation is also atomic – if one of the pairs can't be added, none will be added.\n\n### getMany:\n\nGet many keys at once. This is faster than calling `get` multiple times. Resolves with an array of values.\n\n```js\nimport { get, getMany } from 'idb-keyval';\n\n// Instead of:\nPromise.all([get(123), get('hello')]).then(([firstVal, secondVal]) =\u003e\n  console.log(firstVal, secondVal),\n);\n\n// It's faster to do:\ngetMany([123, 'hello']).then(([firstVal, secondVal]) =\u003e\n  console.log(firstVal, secondVal),\n);\n```\n\n### update:\n\nTransforming a value (eg incrementing a number) using `get` and `set` is risky, as both `get` and `set` are async and non-atomic:\n\n```js\n// Don't do this:\nimport { get, set } from 'idb-keyval';\n\nget('counter').then((val) =\u003e\n  set('counter', (val || 0) + 1);\n);\n\nget('counter').then((val) =\u003e\n  set('counter', (val || 0) + 1);\n);\n```\n\nWith the above, both `get` operations will complete first, each returning `undefined`, then each set operation will be setting `1`. You could fix the above by queuing the second `get` on the first `set`, but that isn't always feasible across multiple pieces of code. Instead:\n\n```js\n// Instead:\nimport { update } from 'idb-keyval';\n\nupdate('counter', (val) =\u003e (val || 0) + 1);\nupdate('counter', (val) =\u003e (val || 0) + 1);\n```\n\nThis will queue the updates automatically, so the first `update` set the `counter` to `1`, and the second `update` sets it to `2`.\n\n### del:\n\nDelete a particular key from the store.\n\n```js\nimport { del } from 'idb-keyval';\n\ndel('hello');\n```\n\n### delMany:\n\nDelete many keys at once. This is faster than calling `del` multiple times.\n\n```js\nimport { del, delMany } from 'idb-keyval';\n\n// Instead of:\nPromise.all([del(123), del('hello')])\n  .then(() =\u003e console.log('It worked!'))\n  .catch((err) =\u003e console.log('It failed!', err));\n\n// It's faster to do:\ndelMany([123, 'hello'])\n  .then(() =\u003e console.log('It worked!'))\n  .catch((err) =\u003e console.log('It failed!', err));\n```\n\n### clear:\n\nClear all values in the store.\n\n```js\nimport { clear } from 'idb-keyval';\n\nclear();\n```\n\n### entries:\n\nGet all entries in the store. Each entry is an array of `[key, value]`.\n\n```js\nimport { entries } from 'idb-keyval';\n\n// logs: [[123, 456], ['hello', 'world']]\nentries().then((entries) =\u003e console.log(entries));\n```\n\n### keys:\n\nGet all keys in the store.\n\n```js\nimport { keys } from 'idb-keyval';\n\n// logs: [123, 'hello']\nkeys().then((keys) =\u003e console.log(keys));\n```\n\n### values:\n\nGet all values in the store.\n\n```js\nimport { values } from 'idb-keyval';\n\n// logs: [456, 'world']\nvalues().then((values) =\u003e console.log(values));\n```\n\n### Custom stores:\n\nBy default, the methods above use an IndexedDB database named `keyval-store` and an object store named `keyval`. If you want to use something different, see [custom stores](./custom-stores.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakearchibald%2Fidb-keyval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakearchibald%2Fidb-keyval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakearchibald%2Fidb-keyval/lists"}