{"_id":"storagedb2","_rev":"5-d0748e5273099741b095edea86a90dee","name":"storagedb2","description":"MongoDB-like API for HTML5 Storage (localStorage and sessionStorage)","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"storagedb2","version":"1.0.0","description":"MongoDB-like API for HTML5 Storage (localStorage and sessionStorage)","main":"lib/index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/instapp/storagedb.git"},"keywords":["storagedb","storagedb2","localStorage","sessionStorage","storage"],"author":{"name":"Acathur"},"license":"MIT","bugs":{"url":"https://github.com/instapp/storagedb/issues"},"homepage":"https://github.com/instapp/storagedb#readme","devDependencies":{"babel-cli":"^6.26.0","babel-loader":"^7.1.2","babel-preset-env":"^1.6.0","webpack":"^3.6.0"},"gitHead":"7dd7e6f89ffd43bb78199135521e6e52ac8a50cb","_id":"storagedb2@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.0.0","_npmUser":{"name":"acathur","email":"chiahungzhang@gmail.com"},"dist":{"integrity":"sha512-4I7OxFJ3H1cHpCpZ4F6sMX4bibFeKlnBtbOnXNaBRYxkJuvLaLDLXXDJUlD3k4bVKkHznhPtUMDENDRoX9heQw==","shasum":"e65e961e1e5b11289786e30c486b02cd02b5f4c4","tarball":"https://registry.npmjs.org/storagedb2/-/storagedb2-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0F5Oqm+BPCaaILAYeC1EJ8999PcCA1Auy/WL5hhpaGwIgBIs2IJmAgA56L3762eL2dLHQ564NKNHKGOxrU5FFcWg="}]},"maintainers":[{"name":"acathur","email":"chiahungzhang@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storagedb2-1.0.0.tgz_1505660139293_0.5814861974213272"},"directories":{}},"1.0.1":{"name":"storagedb2","version":"1.0.1","description":"MongoDB-like API for HTML5 Storage (localStorage and sessionStorage)","main":"lib/index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/instapp/storagedb.git"},"keywords":["storagedb","storagedb2","localStorage","sessionStorage","storage"],"author":{"name":"Acathur"},"license":"MIT","bugs":{"url":"https://github.com/instapp/storagedb/issues"},"homepage":"https://github.com/instapp/storagedb#readme","devDependencies":{"babel-cli":"^6.26.0","babel-loader":"^7.1.2","babel-preset-env":"^1.6.0","webpack":"^3.6.0"},"gitHead":"d86fab85380ad591f0d9c267121a237d03fb4829","_id":"storagedb2@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.0.0","_npmUser":{"name":"acathur","email":"chiahungzhang@gmail.com"},"dist":{"integrity":"sha512-LB2Yoly/NkSxZwbRiUxvXrYFIW1SBri+ATjvzRUvY7Yad4KSLikoiU50xo7BLCPpJn6xYcp3JNtP6zoskgxlPA==","shasum":"d5cccc19bf682026944663836ce63d3e0d2fa46f","tarball":"https://registry.npmjs.org/storagedb2/-/storagedb2-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAh2jgfSj6xIvUFGDYF8ZatqQG0HS+yQTnI9EsenDXlFAiBmIbI3OXbxxje+We2QI1JCbc+VhANBt/HdkjtMhCZfZg=="}]},"maintainers":[{"name":"acathur","email":"chiahungzhang@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storagedb2-1.0.1.tgz_1505723269157_0.6023300357628614"},"directories":{}},"1.0.2":{"name":"storagedb2","version":"1.0.2","description":"MongoDB-like API for HTML5 Storage (localStorage and sessionStorage)","main":"lib/index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/instapp/storagedb.git"},"keywords":["storagedb","storagedb2","localStorage","sessionStorage","storage"],"author":{"name":"Acathur"},"license":"MIT","bugs":{"url":"https://github.com/instapp/storagedb/issues"},"homepage":"https://github.com/instapp/storagedb#readme","devDependencies":{"babel-cli":"^6.26.0","babel-loader":"^7.1.2","babel-preset-env":"^1.6.0","webpack":"^3.6.0"},"gitHead":"f489bc3497bf75e293cf6d532ec3fd95fa39c76f","_id":"storagedb2@1.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.0.0","_npmUser":{"name":"acathur","email":"chiahungzhang@gmail.com"},"dist":{"integrity":"sha512-yhyWFOyhTLBqLkKUK6VjVJHzIiwld0cSS6lKKacb699+NsXXl8ZsJqhTHop+CwfxsCjqZ0294GyE2dvI3XEY9Q==","shasum":"3156a1acd914205f7a92ad68f44dc51ac595dd1e","tarball":"https://registry.npmjs.org/storagedb2/-/storagedb2-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH/werKbxTW4f5Ksv6q6pWs1yz+8+NxIG1BpiwQwuCnAIhANyhSLNc/G3IlnhMtWWTALiHqjHHpWm2FWIGJlncmBYN"}]},"maintainers":[{"name":"acathur","email":"chiahungzhang@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storagedb2-1.0.2.tgz_1505809679093_0.5790066460613161"},"directories":{}},"1.0.4":{"name":"storagedb2","version":"1.0.4","description":"MongoDB-like API for HTML5 Storage (localStorage and sessionStorage)","main":"lib/index.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/instapp/storagedb.git"},"keywords":["storagedb","storagedb2","localStorage","sessionStorage","storage"],"author":{"name":"Acathur"},"license":"MIT","bugs":{"url":"https://github.com/instapp/storagedb/issues"},"homepage":"https://github.com/instapp/storagedb#readme","devDependencies":{"babel-cli":"^6.26.0","babel-loader":"^7.1.2","babel-preset-env":"^1.6.0","webpack":"^3.6.0"},"gitHead":"1608bb03fa04470d0b5a92c0735ad3da9e6e0de7","_id":"storagedb2@1.0.4","_npmVersion":"5.3.0","_nodeVersion":"8.0.0","_npmUser":{"name":"acathur","email":"chiahungzhang@gmail.com"},"dist":{"integrity":"sha512-VTC7FED2AAvFQfJacGNNQKJY88M3y3VuPWnJOtb3wSTuXFDlxWPi3sbq2ZVtK/frpqmNPZsisuGBcD2Y0htv/Q==","shasum":"c4f9d3910158f3899c0d78c6b86ef328cbf587dc","tarball":"https://registry.npmjs.org/storagedb2/-/storagedb2-1.0.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvETqhl3ayPSuGINyTmijp9bdBtlkTn/bKAQTPCKCvXgIgeg7tJ8z93S/UflPRbinZx1jzJqZE7YK23doex89YPrs="}]},"maintainers":[{"name":"acathur","email":"chiahungzhang@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storagedb2-1.0.4.tgz_1505822234342_0.6889794261660427"},"directories":{}},"1.0.5":{"name":"storagedb2","version":"1.0.5","description":"MongoDB-like API for HTML5 Storage (localStorage and sessionStorage)","main":"lib/storagedb.js","scripts":{"build":"webpack","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/instapp/storagedb.git"},"keywords":["storagedb","storagedb2","localStorage","sessionStorage","storage"],"author":{"name":"Acathur"},"license":"MIT","bugs":{"url":"https://github.com/instapp/storagedb/issues"},"homepage":"https://github.com/instapp/storagedb#readme","devDependencies":{"babel-cli":"^6.26.0","babel-loader":"^7.1.2","babel-preset-env":"^1.6.0","webpack":"^3.6.0"},"gitHead":"fe21631f7ff80a0aa518fec159c836bebdb4bc64","_id":"storagedb2@1.0.5","_npmVersion":"5.8.0","_nodeVersion":"8.9.2","_npmUser":{"name":"acathur","email":"chiahungzhang@gmail.com"},"dist":{"integrity":"sha512-gTeSyiYhjUr1q8flCD1GtJ6Wj7tJ3Emt7eEZGbzSi6T/I2XVcrPInPbYtzT4IQOjpXgyZzvcWDIdG8KfgSednQ==","shasum":"66459f5a9160040fe02db4db12407a21d37b3794","tarball":"https://registry.npmjs.org/storagedb2/-/storagedb2-1.0.5.tgz","fileCount":17,"unpackedSize":26807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGSRXCRA9TVsSAnZWagAA7pkP/RGScv+tgpdp7Teh9xfj\ns71uwKIOxZKheJcE8V3BPVKKXEF/BYGQ8XOvTRX0BaDbFqMKZBvEy8RKHF72\njLcewKR/pBaTjHEV95B+lR8uBBYpp3+Qhrj4xD1ZkEm4N6vr54Fl1XiECHrh\nOeUlqVXFpBXGanyYldUWm5YI+0Y93vaXoeEy2R9MI7ZvgfUWJXkB240NNWGX\ne5jZL2v81Oj0KJtyYeFY+MKqSN4MdhOfphxigT3ihIZR+lgkoklCOhTOJyZV\nGUWTiQEDMZmNlP+D4B0KsAvjRh4/jaHkQLWC1Kkfjjjf+Hl5qb4Azx4sraHj\n1Uhot+JfDxQrbCu1uE2Z6MYoJPE7pBO5NYdmDqL/Dgw9SBHxhwfdBLCkEvW6\nlIoPJxpKSuMhzDl0R6+OeLWHBA4hhck6ndG9LF/OXjEq4s68TaqJcbfZwGQc\nx19H6PxOc8lSjgiCi1nFzS3S1lWppLriXcApnx8NWTpT15TmYKTjEKF8ZXj/\npGuGg80hXH7y4436Dk++U8RPtUPx5m1/8j4gywVv8CUglOLCJvxmXQLBZRXu\nHRmTiLrzMy+eNbwoWQVy/t8zEfxNEKMn2R7dl3xwlNAwABbhEE5MRn0s6U47\nAi84r5xYhjWFVdr/Mrihed+O7g8OcIlC4yufoMA/+/GRF23VTVK1en+HVmjx\notXN\r\n=rK/0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChc6rNEvdkSdofTmXkcz1/fZ17NINwBEjbILWwWKvj7AiB2y6SP3y9QNkmCM9BzvnAd7+P8gJdjiqWHGPkesDqI/Q=="}]},"maintainers":[{"name":"acathur","email":"chiahungzhang@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storagedb2_1.0.5_1528374358390_0.33183819560824057"},"_hasShrinkwrap":false}},"readme":"# StorageDB\n\n[![npm](https://badge.fury.io/js/storagedb2.svg)](https://www.npmjs.com/package/storagedb2)\n[![license](https://img.shields.io/npm/l/storagedb2.svg)](https://github.com/instapp/storagedb)\n\nMongoDB-like API for HTML5 Storage (localStorage and sessionStorage)\n\n> ***NOTICE***: The npm package name is '**storagedb2**'\n\n## Features\n\n- MongoDB-like API\n- Lightweight, only ***3KB*** (minified and gzipped)\n- No dependencies\n- Easy configuration\n- Well-supported query selectors (`$gt`,`$in`, ...) and options (`skip`, `limit`, `sort`)\n- Automatically cache in memory\n\n## Getting started\n\n### Install\n\n```bash\nnpm install --save storagedb2\n```\n\nImport storagedb to your project (ES6)\n```js\nimport StorageDB from 'storagedb2'\n```\n\nOr add the script to your main HTML file\n```html\n<script src=\"./lib/storagedb.js\"></script>\n```\n\n### Collection Supported methods\n\n- [insert](#insert) `(docs)`\n- [remove](#remove) `(query)`\n- [update](#update) `(query, values, options)`\n- [find](#find) `(query, options)`\n- [findOne](#findOne) `(query, options)`\n- [drop](#drop) `()`\n\n## Usage\n\n### Instantiate\n\n```js\nconst db = new StorageDB({\n    storage: window.localStorage,     // storage object, default is window.localStorage. If you want to store data in memory only, you can set it null\n    database: 'testdb',               // database name, default is 'db'\n    primaryKey: 'id'                  // primary key of collection, default is '_id'\n})\n\n// create collection (table) instance\nconst Users = db.get('users')\n```\n\n### insert\n\n```js\nUsers.insert({\n    id: 100,\n    name: 'Elon',\n    age: 12\n})\n\nUsers.insert([{\n    id: 101,\n    name: 'Larry',\n    age: 21\n}, {\n    id: 102,\n    name: 'Sergey',\n    age: 21\n}])\n```\n\n### find\n\n```js\nUsers.find([100, 102])\n\nUsers.find({\n    name: /y$/,\n    age: {\n        $gte: 20\n    }\n}, {\n    skip: 0,\n    limit: 20,\n    sort: {\n        age: 1\n    }\n})\n```\n\n### find\n```js\nUsers.findOne(102)\n\nUsers.findOne({\n    age: {\n        $ne: 21\n    }\n})\n```\n\n### update\n```js\nUsers.update(100, {\n    age: 47,\n    company: 'The Avengers'\n})\n\nUsers.update({\n    age: 21\n}, {\n    age: 22\n}, {\n    multi: true\n})\n```\n\n### remove\n```js\nUsers.remove(101)\n\nUsers.remove({\n    age: 21\n})\n```\n\n### drop\n```js\nUsers.drop()\n```\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","maintainers":[{"name":"acathur","email":"chiahungzhang@gmail.com"}],"time":{"modified":"2022-05-18T18:38:57.793Z","created":"2017-09-17T14:55:39.500Z","1.0.0":"2017-09-17T14:55:39.500Z","1.0.1":"2017-09-18T08:27:49.257Z","1.0.2":"2017-09-19T08:27:59.957Z","1.0.4":"2017-09-19T11:57:14.407Z","1.0.5":"2018-06-07T12:25:58.538Z"},"homepage":"https://github.com/instapp/storagedb#readme","keywords":["storagedb","storagedb2","localStorage","sessionStorage","storage"],"repository":{"type":"git","url":"git+https://github.com/instapp/storagedb.git"},"author":{"name":"Acathur"},"bugs":{"url":"https://github.com/instapp/storagedb/issues"},"license":"MIT","readmeFilename":"README.md"}