{"_id":"@dzek69/idb-kv","_rev":"2-1621ddcd9dd71cc8629cac0dd6bc416b","name":"@dzek69/idb-kv","dist-tags":{"latest":"2.1.1-ts.2"},"versions":{"2.1.1-ts.0":{"name":"@dzek69/idb-kv","version":"2.1.1-ts.0","description":"A tiny key value API for indexeddb with automatic batching for out of the box performance.","scripts":{"test":"standard && browserify test.js | tape-run | tap-spec","size":"cat index.js | minify | wc -c"},"keywords":["idb","kv","indexeddb","key","value","api","batch","performance"],"types":"index.d.ts","author":{"name":"KayleePop"},"license":"MIT","repository":{"type":"git","url":"https://github.com/kayleepop/idb-kv.git"},"bugs":{"type":"git","url":"https://github.com/kayleepop/idb-kv/issues"},"devDependencies":{"browserify":"^17.0.0","standard":"^17.0.0","muggle-test":"^1.0.0","muggle-assert":"^1.0.0","tape-run":"^10.0.0","tap-spec":"^5.0.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 KayleePop\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@dzek69/idb-kv@2.1.1-ts.0","dist":{"shasum":"fbae52bf6346087d69211abf556db8f82d0725d2","integrity":"sha512-Vv2Sxyjyc3QS7iXJw8mNxyrDL4OV5e5sKAl6QrZOBgTRybqGsPcM1KN7K2nvDum0nJBXMLf81KaJMsw/ErQ4ug==","tarball":"https://registry.npmjs.org/@dzek69/idb-kv/-/idb-kv-2.1.1-ts.0.tgz","fileCount":24,"unpackedSize":21981,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8znUKHIt+isCpXVszGSn1wfZKBghsVEr9azRdzHbiMgIgXE84Yv+A+RvYDZCEA93UOcpGN8KopONXBC/OKZUFzE0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB1F/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/yQ/8CwaCMjr/jasfVTbWiqXeRc1EXNlFEJ8wI1ItMVlt8nMkHV2T\r\nqZaqWRv5DhwWTmMBa4Q+nDn8PSufBTDDC0LjJd7FFQyFBTeJfvL/VtynSo8D\r\ncygH0d1lsh+WnNwhBVPMh/NaNjENBwJKHuGp9W6wDTp/6Hkbo14NxHc1ppFl\r\nCjjxnrURoIDChgl+ykgSl4YHG5QJ5SievK1YhDURiOJxZZi+iUwGnmWs2dQG\r\n8FL8C+VS9CpGvh2oG+ej7rCQQ0Nt25u9vUkITA4ProCzT5P/I4ssxHUbtDqN\r\nR7vhgN6kLSl9UOmp4V4/Uuut3fnF1KBGQ7E2fg7z4uqEcj1P0KFdpCvN26qQ\r\nfw1YkXew7Guc8jn3eaX/oQizkkMu8LX4Wvq7X8G68JCo7pEiuJkOkjvDRp1R\r\n8gIVFhvO68xmKhT9EzPSMRRZUcHoichAMvoXfh1UY8uzzk+6r/Cy1uCbl8uS\r\npgTtXfi2+mrvgXAqZ/eo6CniluRn8WHR9dUyF9EENOz3c/Zw0XGbD0VAUFWA\r\nJDhPQiuyP/FBxY07EqnMVhPqTzzPcG6iiY7W0LPUZsqVe2XJqk524qw2PAps\r\nXMoV2HjuGEZX/XDVtTqHobsRK3XfsBxlH9rYOsmYcixZrDGWnFxfZf720xaA\r\nz6+0FhcKumChD5Y/D219dE2cH1MpFHagyws=\r\n=fXcg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dzek69","email":"npm.spam.here@nitra.pl"},"directories":{},"maintainers":[{"name":"dzek69","email":"npm.spam.here@nitra.pl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/idb-kv_2.1.1-ts.0_1678201215281_0.9278858943171102"},"_hasShrinkwrap":false},"2.1.1-ts.1":{"name":"@dzek69/idb-kv","version":"2.1.1-ts.1","description":"A tiny key value API for indexeddb with automatic batching for out of the box performance.","scripts":{"test":"standard && browserify test.js | tape-run | tap-spec","size":"cat index.js | minify | wc -c"},"keywords":["idb","kv","indexeddb","key","value","api","batch","performance"],"types":"index.d.ts","author":{"name":"KayleePop"},"license":"MIT","repository":{"type":"git","url":"https://github.com/kayleepop/idb-kv.git"},"bugs":{"type":"git","url":"https://github.com/kayleepop/idb-kv/issues"},"devDependencies":{"browserify":"^17.0.0","standard":"^17.0.0","muggle-test":"^1.0.0","muggle-assert":"^1.0.0","tape-run":"^10.0.0","tap-spec":"^5.0.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 KayleePop\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@dzek69/idb-kv@2.1.1-ts.1","dist":{"shasum":"3deea3a683f03ceda5d567f1aca6f28a79a81f34","integrity":"sha512-cLivpR4CfBPtQFyW40WZELrwDNm6ByHfK8KtJnJiDj3AvzPZ1KrFq+N7ClXnkrP0qCrWWjTmY01OgL3BIyCvDw==","tarball":"https://registry.npmjs.org/@dzek69/idb-kv/-/idb-kv-2.1.1-ts.1.tgz","fileCount":24,"unpackedSize":21999,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF2ADz8sYhbO+RD/nWsVFVg1yNUMnlBoHc8L3XyjcXE1AiEAidABX7Kooc+Eig2kd249adEg25cK7TFf96gKZC6Tpjk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB1dKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpePw/7BK/z73j4ppsP365PPGAIcHpxKDz5Djy7qlTjIqr8TBBXCNMR\r\n6yHP59KRtsKd6dTN5LBxs1jd3F5wQqyWeB2qfxpTAJmvk8PcO0/bQ6UsHD3x\r\nM/BHbeaSiGydaoiBWZiQMRwB9Qf/U3MpJwpwRGNcvehhCb7rGWnGHoZ1Zdox\r\ndIMEHLWxB7GwqqiXQq4ehAy4UdDcRlfPjY3eeSq8V39IkQRmfwmjE2lU9hxX\r\nOW2jDnxlzQeBVdds8cZjYhnEzsJbxO4QfYpqaNhECixBuXdbX1mUQiewuPk6\r\nJChrfF6xdDLm/M3/u/XCZgM8zlm6qz9qkgh9doki+iThQRTtJ4HyCZ4l2cwz\r\nmPykaPcUchA+i+oXWbZKDdLF+N3pEUzeXmxbDt4yQMY8UjdL+izRE/Tah9CZ\r\nqabxUeA6LgaV24JJYjGiSl1yx4kZnunsvjx/nvpAd26rvUAkDs3JShKbW5+s\r\nCjSdqypHeRz8F0XFKcIxgAU4StPyo0Y+IQLzRNnEvXINnh+AF5GY+dVOn0ON\r\nJp5zsuw8lyd1df0C9ZSlYTpgfYVBo0mCXiiFN84sx2VwUSGogJfvwoJwWSqS\r\np+zGcP/dbWgQAkitmOcYCSKBsXqvabM3h5NQa4s7Rd+QNs9SuIC8S0dDGAI2\r\nPIkdYHDchg0x6udekSuaQR8JZ48QNqczNPw=\r\n=N+0y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dzek69","email":"npm.spam.here@nitra.pl"},"directories":{},"maintainers":[{"name":"dzek69","email":"npm.spam.here@nitra.pl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/idb-kv_2.1.1-ts.1_1678202698647_0.6888772064600273"},"_hasShrinkwrap":false},"2.1.1-ts.2":{"name":"@dzek69/idb-kv","version":"2.1.1-ts.2","description":"A tiny key value API for indexeddb with automatic batching for out of the box performance.","scripts":{"test":"standard && browserify test.js | tape-run | tap-spec","size":"cat index.js | minify | wc -c"},"keywords":["idb","kv","indexeddb","key","value","api","batch","performance"],"types":"index.d.ts","author":{"name":"KayleePop"},"license":"MIT","repository":{"type":"git","url":"https://github.com/kayleepop/idb-kv.git"},"bugs":{"type":"git","url":"https://github.com/kayleepop/idb-kv/issues"},"devDependencies":{"browserify":"^17.0.0","standard":"^17.0.0","muggle-test":"^1.0.0","muggle-assert":"^1.0.0","tape-run":"^10.0.0","tap-spec":"^5.0.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 KayleePop\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@dzek69/idb-kv@2.1.1-ts.2","dist":{"shasum":"dae97847e5c70aedc712b2fd06677dd0cb54f38b","integrity":"sha512-bgJFaxwwdabZz/5boyQl8rBr2wCdfljDGs+kGbXbPgo5BZKWaOlP8MngdnzJ3aq8HimgBXDlfLjjT1VNVG3oqg==","tarball":"https://registry.npmjs.org/@dzek69/idb-kv/-/idb-kv-2.1.1-ts.2.tgz","fileCount":24,"unpackedSize":22000,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHoS7SHZ2/JP1RnIqdFZn5ci4H8sCYjsSbK1rucn5GSNAiEAxZDbtOd/9ZYDsa2onGIGPfJ1tzNwLLvK6kzrpAF02hE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB1f8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSchAAgVz6nfVXYyzP8UqRWYs2jiH+mc3+w1+hJqqVA8ut/qEN1a8G\r\nOffSBWiICzhDh56LDR7sMRYTwo/ue+KtSLSl/52slp5bCXfueEcjXochU0YL\r\n1kRx3wcuz7ehDcTMVRtaWu1blBjfQUSOVQ9goAuiypJskS1HQywrtGPaiBPj\r\nGxR/O2seJMhvw69QdWW+0joBkW6GhQswJCQh+rk2cSL3cdlQMRyvl4+/4yAz\r\nzm/XLLDxpwRDc9BJOSWysTTctCSxppP7qULi+Xwl0AcysAmQ8PAoqpj4Eb71\r\nfrGIKjoaFORmOvrsUXbAVOhuJz3oRoImUB2JX1Vh9jqQ9LAmPa+ElSFn1rqo\r\nFVz/0hInX6+yHJZltOuZIyjHuyAoYgnGVy+xxXJAR3zYfSVEok9+v+eqK82a\r\nlI65uUkBAsCGyPfjvt+SzsT5+BZ0RgRTYRJmLL0qjxKdtryRv/zP/uqica+G\r\nvq3bBpdTUCDJ+xAJ2f1B7yN3xI6mdJr+AL78yWtr+MybsSeqSP7aqxVPxhps\r\njJ1MQdWsllqgSWV4Mn8+VCP0BYLDCI1QnxT8rCpx+Gdl4m8/NCbCbWC76fEJ\r\nODxjpxD5EEOTS4rl5WbiOnEDvSeVO3Je3QojJLAAoNNvwW+7ipSHjTuT4unf\r\n8pcTWlMbZ9a8eP7EaYbyXMyNw/r3kxV3dms=\r\n=4YoN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dzek69","email":"npm.spam.here@nitra.pl"},"directories":{},"maintainers":[{"name":"dzek69","email":"npm.spam.here@nitra.pl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/idb-kv_2.1.1-ts.2_1678202876608_0.8947058885582642"},"_hasShrinkwrap":false}},"time":{"created":"2023-03-07T15:00:15.169Z","2.1.1-ts.0":"2023-03-07T15:00:15.466Z","modified":"2023-03-07T15:27:56.897Z","2.1.1-ts.1":"2023-03-07T15:24:58.860Z","2.1.1-ts.2":"2023-03-07T15:27:56.818Z"},"maintainers":[{"name":"dzek69","email":"npm.spam.here@nitra.pl"}],"description":"A tiny key value API for indexeddb with automatic batching for out of the box performance.","keywords":["idb","kv","indexeddb","key","value","api","batch","performance"],"repository":{"type":"git","url":"https://github.com/kayleepop/idb-kv.git"},"author":{"name":"KayleePop"},"bugs":{"type":"git","url":"https://github.com/kayleepop/idb-kv/issues"},"license":"MIT","readme":"# FORK AHEAD\n\nThis is temporary fork of [idb-kv](https://www.npmjs.com/package/idb-kv).\n\nIt adds TypeScript typings. It's meant to be used for test purposes until the original package is updated.\nYou probably should use the original package instead.\n\n# Idb-kv\n\n [![Node.js CI](https://github.com/KayleePop/idb-kv/workflows/Node.js%20CI/badge.svg)](https://github.com/KayleePop/idb-kv/actions) [![standard badge](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![npm](https://img.shields.io/npm/v/idb-kv.svg)](https://www.npmjs.com/package/idb-kv)\n\n## IndexedDB Key Value Store\n\nA tiny and simple API for IndexedDB with automatic batching for out of the box performance.\n\nAll operations called within a 10ms interval are queued and executed in a single batch transaction. This improves performance when lots of reads and/or writes are performed quickly.\n\n## Goals\n\n- Simple and small API\n- Minimize bundle size\n- Good performance\n- Fully tested\n\n## Usage\n\n### Install\n\n`$ npm install idb-kv`\n\n### Require\n\n```javascript\nlet Idbkv = require('idb-kv')\n\nlet store = new Idbkv('example-store')\n\nstore.set('animals', ['dog', 'cat', 'koala', 'moose', 'chinchilla'])\nstore.set('pastas', ['spaghetti', 'linguine', 'macaroni', 'fettuccine'])\nconst animals = await store.get('animals')\nanimals[2] // >> 'koala'\n```\n\n```javascript\n// new Session\nlet Idbkv = require('idb-kv')\n\nlet store = new Idbkv('example-store') // using the same name loads previous data\n\nconst pastas = await store.get('pastas')\npastas[1] // >> \"linguine\"\n```\n\n## Batching\n\nBecause actions are batched, you only have to listen to a single promise for every set or delete in a synchronous block of code because they all share a common promise that indicates the success or failure of the entire batch transaction.\n\nThis may provide a performance benefit with a large number of writes by eliminating promise handler overhead.\n\n```javascript\nstore.set(0, 'first')\nstore.set(1, 'second')\nstore.set(2, 'third')\nstore.set(3, 'fourth')\nstore.delete(3)\n  .then(() => console.log('all 4 sets and delete completed successfully'))\n```\n\nThe order of actions is maintained when batching.\n\n```javascript\nstore.delete(0)\nstore.get(0) // resolves with >> undefined\nstore.set(0, 'first')\nstore.get(0) // resolves with >> \"first\"\n```\n\n## API\n\n### new Idbkv(dbName, [{batchInterval: 10}])\n\n```javascript\nlet store = new Idbkv('example-store')\n\n// this store will gather actions for 1000ms before executing a transaction\nlet slowStore = new Idbkv('slow-store', {batchInterval: 1000})\n```\n\nCreate a new Idbkv store instance using `indexedDB.open(dbName)` for data. Two instances created with the same name will use the same data store.\n\n`batchInterval` is the number of milliseconds to wait for more actions before a batch transaction is performed. The default is 10ms. Higher values improve batching, but also increase the delay for actions to complete including get().\n\n### _async_ get(key)\n\n#### Read a value from the store\n\n```javascript\nstore.get('animals') // resolves with >> ['dog', 'cat', 'koala', 'moose', 'chinchilla']\nstore.get('nonexistent') // resolves with >> undefined\n```\n\nReturns a promise that resolves with the value corresponding to `key`, or rejects due to errors thrown by IndexedDB.\n\nIf the key doesn't exist in the database, then get() resolves with `undefined`.\n\n### _async_ set(key, value)\n\n#### Write a value to the store\n\n```javascript\nstore.set('pastas', ['spaghetti', 'linguine', 'macaroni', 'fettuccine'])\nconst pastas = await store.get('pastas')\npastas[1] // >> \"linguine\"\n```\n\nReturns a promise that resolves when the data is successfully written to the disk, or rejects on IndexedDB errors.\n\n### _async_ delete(key)\n\n#### Remove a value from the store\n\n```javascript\nlet store = new Idbkv('example-store')\nstore.set('pastas', ['spaghetti', 'linguine', 'macaroni', 'fettuccine'])\nstore.delete('pastas')\nstore.get('pastas') // resolves with >> undefined\n```\n\nReturns a promise that resolves when the data is successfully deleted from the disk or rejects on indexedDB errors.\n\n### _async_ destroy()\n\n#### Delete the database, and tear down the Idbkv instance\n\n```javascript\nlet store = new Idbkv('example-store')\nstore.get('color') // resolves with >> \"blue\"\nawait store.destroy()\n\nstore = new Idbkv('example-store')\nstore.get('color') // resolves with >> undefined\n```\n\nCloses and then deletes the underlying IndexedDB database. This is basically equivalent to calling `store.delete()` on every existing key in the store.\n\nReturns a promise that resolves when the database is successfully deleted or rejects on an error.\n","readmeFilename":"README.md"}