{"_id":"@37o1/httpdb","_rev":"4-2554f08ea7b015726d1786696f5b1a59","name":"@37o1/httpdb","dist-tags":{"latest":"1.1.0-stable"},"versions":{"1.0.0":{"name":"@37o1/httpdb","version":"1.0.0","description":"TypeScript/JavaScript http based database","main":"dist/main.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"37o1"},"license":"ISC","dependencies":{"@types/node":"^20.12.7","lw-db":"^1.0.2","node":"^18.20.2","node-fetch":"^2.7.0"},"types":"types/main.d.ts","_id":"@37o1/httpdb@1.0.0","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-MAzUms1XsHfnrx+nn8QH3GiYmJ3Gzwfc6NTlGtoYSSJ+0ZYVzujwuri5hiCqnW3CiS2LjnV9TCaK+mU5h7hB9Q==","shasum":"ccd0cb28c4f59a6ee79542ec46b180e3d72951fb","tarball":"https://registry.npmjs.org/@37o1/httpdb/-/httpdb-1.0.0.tgz","fileCount":6,"unpackedSize":35232,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHT2vvyaqpw5pIIF9wuE2VMrAOj2QLLQ+jJp2N4JpMG0AiEAxO1uaZef+y7h9YCn5/zEo8P0dPse10Sj6Jz3By6Z+DE="}]},"_npmUser":{"name":"37o1","email":"theneonman0@gmail.com"},"directories":{},"maintainers":[{"name":"37o1","email":"theneonman0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/httpdb_1.0.0_1713876369100_0.47437247335902755"},"_hasShrinkwrap":false},"1.0.1":{"name":"@37o1/httpdb","version":"1.0.1","description":"TypeScript/JavaScript http based database","main":"dist/main.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"37o1"},"license":"ISC","dependencies":{"@types/node":"^20.12.7","lw-db":"^1.0.2","node":"^18.20.2","node-fetch":"^2.7.0"},"types":"types/main.d.ts","_id":"@37o1/httpdb@1.0.1","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-iLtafKnDcX5D9q5OvQy+PWPOwe7M24ZPbXPbvI+ThUq82sR6p00waMu2ht+m6xIf80HyoOAiJG8J5VgFHZk47g==","shasum":"30a3723cb4d72ecab979c1621a8f6de973afadb6","tarball":"https://registry.npmjs.org/@37o1/httpdb/-/httpdb-1.0.1.tgz","fileCount":6,"unpackedSize":35233,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8GsfKowgJm26IV6qip92F7tO+4JsQUIZxiZ7NDR+BSgIhAJ2ObA+MkX5kGJ8GOnkHcYUwCelz9Kvqhvy0Emc6rbN7"}]},"_npmUser":{"name":"37o1","email":"theneonman0@gmail.com"},"directories":{},"maintainers":[{"name":"37o1","email":"theneonman0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/httpdb_1.0.1_1713876416160_0.10977787465080646"},"_hasShrinkwrap":false},"1.0.2":{"name":"@37o1/httpdb","version":"1.0.2","description":"TypeScript/JavaScript http based database","main":"dist/main.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"37o1"},"license":"ISC","dependencies":{"@types/node":"^20.12.7","lw-db":"^1.0.2","node":"^18.20.2","node-fetch":"^2.7.0"},"types":"types/main.d.ts","_id":"@37o1/httpdb@1.0.2","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-uFbcL4BLPC26zH4N55gq9aYoeHApy9E8BY57UaTbLC/PdHCHz9gGgw2oVCGQUah05Kq/0iAcP3LZmeChqBVGeQ==","shasum":"060c05c72121167304c3479e7b060a71a3358f88","tarball":"https://registry.npmjs.org/@37o1/httpdb/-/httpdb-1.0.2.tgz","fileCount":6,"unpackedSize":35234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICqzJzfb7OujaPQAz3Nkcbd07cOAzGvCeRFd8tqSzTNYAiEA7bOByQcIfQ2laLuDyjGrItyO9c6f//Ks8WdKpY65akk="}]},"_npmUser":{"name":"37o1","email":"theneonman0@gmail.com"},"directories":{},"maintainers":[{"name":"37o1","email":"theneonman0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/httpdb_1.0.2_1713876466752_0.928011761178827"},"_hasShrinkwrap":false},"1.0.3":{"name":"@37o1/httpdb","version":"1.0.3","description":"TypeScript/JavaScript http based database","main":"dist/main.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"37o1"},"license":"ISC","dependencies":{"@types/node":"^20.12.7","lw-db":"^1.0.2","node":"^18.20.2","node-fetch":"^2.7.0"},"types":"types/main.d.ts","_id":"@37o1/httpdb@1.0.3","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-2BW8vJJXljN2/l2RzB8yIUEdYXhZB40V0Z7pURTLW8J/RQP8Jy87E0doVc7SL8+k1GK4jPNUJ+Kkh3R+KRuCzQ==","shasum":"b55e4c24b72cf7d75bf5d3d6edf7c54c10aafd93","tarball":"https://registry.npmjs.org/@37o1/httpdb/-/httpdb-1.0.3.tgz","fileCount":6,"unpackedSize":35081,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1Fi/5snKdXg3pO8EG4C8pEIt9c1hExe4se7VDLSdRBAiBn/QotBCf9bHcqlkE9Mm+Iey6GFdNB2lWrLgLkb0Utjw=="}]},"_npmUser":{"name":"37o1","email":"theneonman0@gmail.com"},"directories":{},"maintainers":[{"name":"37o1","email":"theneonman0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/httpdb_1.0.3_1713877007485_0.1848275892157687"},"_hasShrinkwrap":false},"1.1.0-stable":{"name":"@37o1/httpdb","version":"1.1.0-stable","description":"TypeScript/JavaScript http based database","main":"dist/main.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"37o1"},"license":"ISC","dependencies":{"@types/node":"^20.12.7","lw-db":"^1.0.2","node":"^18.20.2","node-fetch":"^2.7.0"},"types":"types/main.d.ts","_id":"@37o1/httpdb@1.1.0-stable","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-yARhDUzCMCo26TbAsn8+MFGcHccuPvKxDg8BZbhw6zX3ZPp7KB0JRcU5zZS6T2UJFhkSBy0+VqhulVWJritWiQ==","shasum":"accc71d503a3c9da87c6647539ef00237b8b5a9d","tarball":"https://registry.npmjs.org/@37o1/httpdb/-/httpdb-1.1.0-stable.tgz","fileCount":6,"unpackedSize":34938,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/4wTgroOKRDnMMYASJsZuorhmTz0n66ws5cfGGviVhgIgWOlISQTF1Q8u5GtGIwsBzUpBQawMvJttxoEAWbI9dTw="}]},"_npmUser":{"name":"37o1","email":"theneonman0@gmail.com"},"directories":{},"maintainers":[{"name":"37o1","email":"theneonman0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/httpdb_1.1.0-stable_1713878462975_0.4204843099542015"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-23T12:46:08.988Z","1.0.0":"2024-04-23T12:46:09.243Z","modified":"2024-04-23T13:21:03.341Z","1.0.1":"2024-04-23T12:46:56.310Z","1.0.2":"2024-04-23T12:47:46.876Z","1.0.3":"2024-04-23T12:56:47.663Z","1.1.0-stable":"2024-04-23T13:21:03.192Z"},"maintainers":[{"name":"37o1","email":"theneonman0@gmail.com"}],"description":"TypeScript/JavaScript http based database","keywords":[],"author":{"name":"37o1"},"license":"ISC","readme":"# HttpDB\n\n*An extension to [LW-DB](https://www.npmjs.com/package/lw-db) that adds query and lan use*\n\nHttpDB is a wrapper module for lw-db that allows multiple nodejs processes and compatible apps to access one database without the need of process synchronization. It also allows multiple computers to access the same database, however I do not advise doing that.\n\n## Setup\n\n**ES5**\n```js\nconst { dbserver, dbclient } = require(\"httpdb\");\n\nconst server = new dbserver(\"path/to/db/folder\", true); // set up the database server\nconst client = new dbclient(server.accessToken); // use client to access the database\n```\n\n**ES6**\n```js\nimport { dbserver, dbclient } from \"httpdb\";\n\nconst server = new dbserver(\"path/to/db/folder\", true);\nconst client = new dbclient(server.accessToken);\n```\n\nYou can define the client in any process or computer you wish.\n\nIn order to access a remote database you need to be able to establish a TCP connection between the two machines.\nSetting up a local database for multiple machines is fine if you trust the devices and their users.\nYou can set up muliple databases for multiple users if you want to set up granular access control.\n\n**If you want to extend security I advise you to do somthing like the following:**\n\n```js\nconst server = require(\"http\").createServer();\nconst dbserver = new require(\"httpdb\").dbserver(\"path/to/db/folder\", false);\n\nserver.on(\"request\", (req, res) => {\n\n    var passed = false;\n    \n    // here you canb implement your own security/access-control system\n    // set passed to true is security checks passed\n\n    if (passed) dbserver.handle(req, res);\n});\n```\n\n## Notes\n\nThis module purely uses headers for client to server transmit\nMake sure to set the max header size to a high value if you expect the client(s) to write a lot of data to a single file\n\n### Reserved headers\n\n`token`: accessToken\n`action`: action flag\n`data`: strigified JSON data\n\n### `lw-db`\n\nThe underlying module of httpdb is lw-db, a node:fs wrapper module!\nThis module is a pure JSON database that works locally and **does not ecrypt data**.\nMake sure to implement your own data encryption medthod.\n\n## Disclaimers\n\nThis module **DOES NOT ENCRYPT DATA**! Not in transmit and neither when saving.\nThis module **DOES NOT BACK UP**!\n\n**THIS MODULE IS IN ACTIVE DEVELOPMENT! I AM NOT LIABLE IN ANY WAY FOR ANY OR FORM FOR ANY DATA LEAK OR DATA LOSS!**","readmeFilename":"readme.md"}