{"_id":"@allnulled/simplest-db","_rev":"4-9bd39e18562f69c8c7ea648785bcb180","name":"@allnulled/simplest-db","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@allnulled/simplest-db","version":"1.0.0","description":"Small synchronous database implementation for node.js and browsers","main":"./src/simplest-db.js","directories":{"test":"test"},"browser":"./src/simplest-db.js","scripts":{"test":"node test/test.test.js"},"keywords":["database","db","sync","localStorage","fs"],"author":{"name":"allnulled"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/allnulled/simplest-db.git"},"bugs":{"url":"https://github.com/allnulled/simplest-db/issues"},"homepage":"https://github.com/allnulled/simplest-db#readme","gitHead":"adfa4bbaed77ec222144d28f9fe56c6b03e946fe","_id":"@allnulled/simplest-db@1.0.0","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-3UDqpy/pT0pW6J55wU52DOsoxJraWersURUIwGLutdsI7HORAM8Hv0BTbatruACd+fpnH1tbmGdR8QSk3nh6BQ==","shasum":"81e8800867d4f51b448aafc61d5b0673e0477f51","tarball":"https://registry.npmjs.org/@allnulled/simplest-db/-/simplest-db-1.0.0.tgz","fileCount":6,"unpackedSize":20803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMgjyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoWxRAAgZfuilr+GTJIEJABMoqhXw+jupfCEtfapjB/UBPJDlGDeytL\r\nBQsVu37b6cP+HooHh9x8Ji7VMlnCwpfTodXBEWVb+D0gZdMo7/CpLbPqBJFt\r\nrQ73gpgxUyp0fxJ7FSZO4EHBd77+oi1F1+WVT409b6PnJNEMQP6TdVzx4Fd5\r\nUgt3Qtpc7+0N3vP7JIHoNJ9yAn40o7UtE94HQ7uOhdAOamgWDCPthFzDsWIa\r\n1RHngcxDWRmNBgqPD1wdvPrs49Vcz+cTCNWwK0vRwBRZNxDcpZWnkABgRUnH\r\nsHu/kizZnoIGaMImfB0+E37celcDN8zUQAlk9WiV3rj0+eeKwA5oOeSfC7ES\r\nJr+jFbh3QWtaSJv2f2BDA+Bhao8EMm2D6f4JODFVE6rNv+sfU0xrIygtujuS\r\nkDGEW7Z0Y2ahzEloo0w2w92tJzIFaiqbF+dFuktlxbjm9DReyOWoSKhV639z\r\nLrQfVd4Qttr0tREHfcaz8ICYfCAJOLHyI1KszPs7c/PI8wQE72Cpc7hm0Onl\r\n+00XczQgLoc5zt8/lZuEyji54d08HUpte+gAA14RljX/n9WPRnUfInDl13ax\r\n2eJnasD9SxI+/15ywmpG7HEDUAhJIKsoCJa9kZxQxx7fgxgkV4PiaiK8BMIK\r\n9ia4SHTXV9tNOVoptcqnMFbEQ5sQK6Ckcj8=\r\n=yLwN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXhVGKZLY04R5R+F7IEotloC7NqSxcbQ0rSH5LZVCWaAIhAL32War8MBx90fTo9S0oPAJufV3CanjaPe2ZRznAP7Ki"}]},"_npmUser":{"name":"allnulled","email":"todosanulados@gmail.com"},"maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simplest-db_1.0.0_1647446257797_0.01761176945044851"},"_hasShrinkwrap":false},"1.0.1":{"name":"@allnulled/simplest-db","version":"1.0.1","description":"Small synchronous database implementation for node.js and browsers","main":"./src/simplest-db.js","directories":{"test":"test"},"browser":"./src/simplest-db.js","scripts":{"test":"node test/test.test.js"},"keywords":["database","db","sync","localStorage","fs"],"author":{"name":"allnulled"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/allnulled/simplest-db.git"},"bugs":{"url":"https://github.com/allnulled/simplest-db/issues"},"homepage":"https://github.com/allnulled/simplest-db#readme","gitHead":"52e5f84715ad4c5b51452b7503114f6fc7fa8921","_id":"@allnulled/simplest-db@1.0.1","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-bMG9HbLvPzbbWptadGa0kyzonZgif3SMJ0Qg6II8TRljvHIorWUgkPZTMFaSqnuWxBSjVuu+8k7LId9mlKXj+Q==","shasum":"5d2203927de3741858f61b86449dea54097819cd","tarball":"https://registry.npmjs.org/@allnulled/simplest-db/-/simplest-db-1.0.1.tgz","fileCount":6,"unpackedSize":20815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMgpeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQlQ//XMfpULHXXvw+JDo9dw11gm6tYUfdl9epFboU3+dvLvUD3HOz\r\npbormqotSc/xjKV4l++lx16zg6PJXNhetPgAjSXDpC7TCXurkWjVSWgtXZIm\r\n2ypSkl+jhgBonJ4F3jM6gItVebMnvsuaXX8wJUf8jogKU2xop6fozV9wRtf7\r\nxfitSmV65yi3RitTap8/GAXFP3pkhpDbr8ZAaqpyvRlwRp1w2K/VC1POiUVk\r\nK2Zz+nWoSiW0BJoCsAtF8kYyfkvEfWvi5+nuuY3CkGYj1Q+wLzc3cQ0o2P4k\r\ne3QS8PIM96DN+kWu7xfEOlp5/zcfaOsuQsnL79q3wVnH/xQLS7soFq6SUrDL\r\nURp1/4xzOn7qExr8QrAiE/jLZjgyN/bULJm5M2rOoDtQ+4l6E8GAmtNhX3ey\r\niwDB2I6bSoe+3xs/JsuYPS/YpISh0vdWocIXRs2FluJUcrbRxuSAx2KjA0E6\r\nOJCdyHjVlB76aBuLp5Vo71D8yHidteH5rMr3HlwDUZUCNSzHMfdWyJvMha6F\r\npBqdNH9k7QrIrXvAAF9pdWpVGC4Uq1phqy49dWWXELK2A4xwIHQ7yTy95A2f\r\niDKMeSlaJF6oibO4UkQvfAFfiir8krJsfnQ3QtUAxnIEgKLUrTkPDL4lioR2\r\nSlbHEAEjsWgFWdc2bSgI5EoPdj7ZsIRgeVI=\r\n=mnjW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFRkRQW32tRxD/wgSTpLGc3XvYvR0qbMWRCPHGm3TK0FAiEAqoWiTKGqf/H3CcwmewW6PvKr4EhStaZCu34cXPfu2hU="}]},"_npmUser":{"name":"allnulled","email":"todosanulados@gmail.com"},"maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simplest-db_1.0.1_1647446622654_0.023151506426652313"},"_hasShrinkwrap":false},"1.0.2":{"name":"@allnulled/simplest-db","version":"1.0.2","description":"Small synchronous database implementation for node.js and browsers","main":"./src/simplest-db.js","directories":{"test":"test"},"browser":"./src/simplest-db.js","scripts":{"test":"node test/test.test.js"},"keywords":["database","db","sync","localStorage","fs"],"author":{"name":"allnulled"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/allnulled/simplest-db.git"},"bugs":{"url":"https://github.com/allnulled/simplest-db/issues"},"homepage":"https://github.com/allnulled/simplest-db#readme","gitHead":"a421aa3ca1740d6819eb376fea10849b5344bbf4","_id":"@allnulled/simplest-db@1.0.2","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-LyUA6AhAsRjJfmyoKR46Uz+dEeuAM1ojYGils7FRSx+YC39W9uCG6LI4cc0OUKvsl3b4pOBjXINaA5YH1yvN5A==","shasum":"62251b697d97785a0dc608e364660664f94cf879","tarball":"https://registry.npmjs.org/@allnulled/simplest-db/-/simplest-db-1.0.2.tgz","fileCount":6,"unpackedSize":20867,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMg21ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpG1A/+IS+eYAO8o5cKRi9SjQDkPRqabz0cBn2+6cuJMY2NW/9pYWel\r\nq2Q5isDFqXprP2uu9xC//dT/67NvIHu5JdKzii09gRfku/ja07nJbeQ7GWDv\r\njYBiXWIQ4dPqNv3SefIT6xdX8PXL7MZatVOb2WjZsKJzKwCg21ldxRFGMtvU\r\n9ZDTZjqHAee91WiiaBwnqKm2GRwp/d1rfmh5sSVn0mvd6xb4ZDjI+bFDLwsB\r\ndfsye79/TvDFUb2JXmE14PZSoYkvJvEZqoYe5tJuvKEsQhDlVWFUyhOaOoNb\r\n+fNiWqdrZAZkhxBndQpTwDvYJoRJYaLrbOQdqZzZHiHi9tBM8QPRlJfA+auD\r\nwPYqLJNiOEh/rwEOkBZOMEg7cWV0CJl6pGKdxMlcBZc0cDnsMjURgX1LR+W/\r\nLafxjMPOv5ySr+/3Ph80XX7Ygybdg7zqHn+TjiS5mcQC//NRnN3LqmfTOo34\r\npKVoXE9oMQRuuzC0ME+RY55AvrBRzhUO9ROiyi/pxr7gOzEGHa4yDxyMzlhJ\r\n3fH0+nHul4JnbWdzF5sz0wNxvjA1604K163tiWb4hBOC7Q6DO26aJ2IEBuPH\r\nXxpcDYOfe3pVolmf6BD/D63OvG92xDTO1bJyHu9t/HqAXDwslxmrTuEA6Tpd\r\nyDhdgisbqA+Sdxf4EFWnRV2czRng8ZTNBuk=\r\n=sf4M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIpCHk6IsXeEYu/0DXp17SS7rCFrwT/OkxhO7hObrXyAIgJKFCJVJHR+ngbskS6YRih8HzFtWzVJCyMOBqVVkO8Vg="}]},"_npmUser":{"name":"allnulled","email":"todosanulados@gmail.com"},"maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simplest-db_1.0.2_1647447477391_0.9598390636025769"},"_hasShrinkwrap":false},"1.0.3":{"name":"@allnulled/simplest-db","version":"1.0.3","description":"Small synchronous database implementation for node.js and browsers","main":"./src/simplest-db.js","directories":{"test":"test"},"browser":"./src/simplest-db.js","scripts":{"test":"node test/test.test.js"},"keywords":["database","db","sync","localStorage","fs"],"author":{"name":"allnulled"},"license":"WTFPL","repository":{"type":"git","url":"git+https://github.com/allnulled/simplest-db.git"},"bugs":{"url":"https://github.com/allnulled/simplest-db/issues"},"homepage":"https://github.com/allnulled/simplest-db#readme","gitHead":"89f75822ada7461de14e11286d4201e235cac8bc","_id":"@allnulled/simplest-db@1.0.3","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-SRgLvn9+XB6f9seDAD5VGAytHcKFeMjy4PlBt28ntEUTsGZhT/4YlKNR2mycbQHS2NEuJk32XmMPX8GSpqjM3Q==","shasum":"1fb484f3d5f9670c9d66e6926a6dc0c1c338cb23","tarball":"https://registry.npmjs.org/@allnulled/simplest-db/-/simplest-db-1.0.3.tgz","fileCount":7,"unpackedSize":26207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMjqpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJlQ/6Ag+eiVHB1vIBSvXsGEdGkSHb4r9UrPnr6XJy1Bzbui0cVQ+b\r\n+Th2+aIUl3dlkrg1ktPh4CvFjqTxWsWiJrk6aBNent067+mnaRKQqyMkvmbH\r\ncYroMtkqaN/4HmVEjCwTx0ybIGVqCNF8q2mBfBA7Y9O6dq9XWNoMB1K9GzE+\r\ng5IzyMEa7LmfVs8vP1AUDYJTryBpJkoben1BZMIFmukb2ZNRTSgJ8RjXIQJs\r\nSHIram1oiKtui2yurzoNCByv3YXbVw5UuFQ/vQckZjrTSRKE71q0myleK+ur\r\ndcL/Ql+WCe+SP9HhKLBYRb0niAxeyV3H/TySoP5DCZ8Dy6lAIsMH0BUj3dG2\r\nqPvsJABKMtvu5Hg2J2q+G34GS7xhki/Z1WkqpbrabOSif0yYFGj44veW2K/r\r\nYfDQuRdrimzUyXMR7x0fH2sQwRDTY1Ip+D7l32ZdDZZaK5OyCiZkAhPheGzr\r\nr8uJTVYqjYU/5NWBnqNhVUWOIvNrq4JWTQrcWQvRpFsGeuBzLqBDkex2mMWS\r\n4NHn293EcowhJvqHDfHwPihD9HM49SgUSNBApGPHr6LCFuJO/iQfIycXo9jf\r\nD3oTokdEoyA1S29w+KuexuLGzuIxwr79Ijrqv2AiHsEuN4HVzwC8nxZD7pWP\r\nhfs5oi7FqJnlWBiSruK8OrqdbpwbTFz8FB8=\r\n=yqid\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRilgi0wAuB4ZO3zvGuurLL12eoGQimfkJlS+5qsMzhgIhAOwyaBkqtXkE44aliPIVm5eqbbbrcSIdpv0Q0kxfIAhm"}]},"_npmUser":{"name":"allnulled","email":"todosanulados@gmail.com"},"maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simplest-db_1.0.3_1647458985587_0.5262815625395212"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-16T15:57:37.748Z","1.0.0":"2022-03-16T15:57:38.013Z","modified":"2022-04-04T13:33:32.122Z","1.0.1":"2022-03-16T16:03:42.873Z","1.0.2":"2022-03-16T16:17:57.610Z","1.0.3":"2022-03-16T19:29:45.743Z"},"maintainers":[{"name":"allnulled","email":"todosanulados@gmail.com"}],"description":"Small synchronous database implementation for node.js and browsers","homepage":"https://github.com/allnulled/simplest-db#readme","keywords":["database","db","sync","localStorage","fs"],"repository":{"type":"git","url":"git+https://github.com/allnulled/simplest-db.git"},"author":{"name":"allnulled"},"bugs":{"url":"https://github.com/allnulled/simplest-db/issues"},"license":"WTFPL","readme":"# simplest-db\n\nSmall synchronous database implementation for node.js and browsers.\n\n[![NPM](https://nodeico.herokuapp.com/@allnulled/simplest-db.svg)](https://www.npmjs.com/@allnulled/simplest-db)\n\n## 1. Installation\n\n```sh\n~$ npm i -s @allnulled/simplest-db\n```\n\n## 2. How it works\n\nThis script works the same for `node.js` and `browser`.\n\nWhat the script is thought for, is to be used as `synchronous database` for both `javascript` environments.\n\nOn the `node.js` side, it works with files and the `require(\"fs\")` API.\n\nOn the `browser` side, it works with `localStorage` API.\n\n## 3. Usage\n\n### 3.1. Install:\n\nIn node.js you rely on `require` function and the `node_modules` of the `npm`.\n\nIn browser you need to import `simplest-db.js` by a script tag like:\n\n```html\n<script src=\"/path/to/some/cdn/network/and/find/simplest-db.js\"></script>\n```\n\nIf case you use `webpack` or `browserify` or some tool to pack your browser scripts, you can use `import` and `require` syntax too with `\"simplest-db\"` parameter.\n\n### 3.2. Import:\n\nIn node.js:\n\n```js\nconst SimplestDB = global.SimplestDB || require(\"@allnulled/simplest-db\");\n```\n\nIn browser:\n\n```js\nconst SimplestDB = window.SimplestDB;\n```\n\nNote: the `import` syntax of ES6 will also work.\n\n### 3.3. Create database:\n\n```js\nconst db = SimplestDB.create({\n    schema: \"Unique schema id\",\n    attributes: { /* custom schema attributes */ },\n    tables: {\n        fichero: {\n            attributes: { /* custom table attributes */ }.\n            columns: {\n                ruta: {\n                    attributes: { /* custom column attributes */ },\n                    is_type: \"string\",\n                }\n            }\n        }\n    }\n});\n```\n\n### 3.4. Insert into database:\n\n```js\ndb.insert(\"fichero\", {\n    ruta: \"/root/index.js\",\n    contenido: \"console.log('hi!!!')\"\n});\n```\n\n### 3.5. Select from database:\n\n```js\ndb.select(\"fichero\", f => {\n    return f.ruta && f.ruta.startsWith(\"/root/\");\n});\n```\n\n### 3.6. Update from database:\n\n```js\ndb.update(\"fichero\", 1, {\n    contenido: \"console.log('bye!')\"\n});\n```\n\n### 3.7. Delete from database:\n\n```js\ndb.delete(\"fichero\", 1);\n```\n\n## 4. Features\n\nSome **enjoyable** features:\n\n- Fully synchronous API.\n- Browser (`localStorage`) and node.js (`require(\"fs\")`) support.\n\nSome **missing** features:\n\n- NO support for automatic column checkings, only for table checking. To do so, override `validateRow` method.\n\n### 4.1. Extra features\n\nSince version `1.0.3`, `@allnulled/simplest-db` comes with 2 extra APIs: **Cache API** and **Filesystem API**.\n\nThe **Filesystem API**:\n\n- Included API for files at: `SimplestDB.getFS()`.\n  - Contains a `SimplestDB` instance with `\"system\"` as schema (so: `./sdb_modules/system.data.json` or `localStorage.SDB_STORAGE_FOR_system`).\n  - Accepts tables: `fs`.\n  - Accepts columns: `fs.path`, `fs.contents`, `fs.metadata`.\n\nThe **Cache API**:\n\n- Included API for cache at: `SimplestDB.getCache()`.\n  - Contains a `SimplestDB` instance with `\"system\"` as schema too (so also: `./sdb_modules/system.data.json` or `localStorage.SDB_STORAGE_FOR_system`).\n  - Accepts tables: `cache`.\n  - Accepts columns: `cache.key`, `cache.value`.\n\n## 5. License\n\nNo license.\n\n## 6. Why?\n\nTo have another awesome javascript database. Synchronous. Light. Simpler.","readmeFilename":"README.md"}