{"id":19391913,"url":"https://github.com/fwd/database","last_synced_at":"2025-04-24T00:31:55.328Z","repository":{"id":38818307,"uuid":"288250798","full_name":"fwd/database","owner":"fwd","description":"SQL-like JSON Database","archived":false,"fork":false,"pushed_at":"2025-03-28T22:28:47.000Z","size":854,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T22:51:16.486Z","etag":null,"topics":["database","embedded","json"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fwd.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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}},"created_at":"2020-08-17T18:01:38.000Z","updated_at":"2025-02-21T21:44:45.000Z","dependencies_parsed_at":"2024-11-10T10:30:53.811Z","dependency_job_id":"9c556994-0e01-41f3-8ed1-9da3ebdb75b9","html_url":"https://github.com/fwd/database","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwd%2Fdatabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwd%2Fdatabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwd%2Fdatabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwd%2Fdatabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwd","download_url":"https://codeload.github.com/fwd/database/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250539511,"owners_count":21447327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["database","embedded","json"],"created_at":"2024-11-10T10:29:39.511Z","updated_at":"2025-04-24T00:31:53.079Z","avatar_url":"https://github.com/fwd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Cover](https://raw.githubusercontent.com/fwd/database/master/.github/banner.png)\n\n## Install\n\nLatest Version\n```sh\nnpm install fwd/database\n```\n\nStable Version\n```sh\nnpm install @fwd/database\n```\n\n## Setup\n\n```js\nconst lowDb = require('@fwd/database')('lowdb') // json flat file\nconst localDb = require('@fwd/database')('local') // json multi-file\nconst SQlite = require('@fwd/database')('sqlite') // in development\nconst mongoDb = require('@fwd/database')('mongodb') // coming soon\nconst mySQL = require('@fwd/database')('mysql') // coming soon\n```\n\n## Use\n```js\n\n// initalize database\nconst database = require('@fwd/database')('local')\n\n;(async () =\u003e {\n  \t\n\t// create user\n\tawait database.create('users', {\n\t\tfname: \"Leeroy\",\n\t\tcompany: \"WoW\"\n\t})\n\t\n\t// find user\n\tvar user = await database.findOne('users', {\n\t\tfname: \"Leeroy\"\n\t})\n\t\n\t// update user\n\tawait database.update('users', user.id, {\n\t   lname: \"Jenkins\"\n\t})\n\t\n\t// delete user\n\tawait database.delete('users', user.id)\n  \n})()\n\n```\n\n### API\n\n```js\n\n;(async () =\u003e {\n\t\n\t// find users\n\tawait database.get('users') // returns all\n\tawait database.find('users', { id: 2 }) // array\n\tawait database.findOne('users', { id: 2 }) // object\n\tawait database.findFirst('users', query) \n\tawait database.findLast('users', query)\n\t\n\t// query users (advanced)\n\tawait database.query('users', '[country=NZ].name')\n\t\n\t// create user\n\tvar user = await database.create('users', { fname: \"John\" })\n\t\n\t// update users\n\tawait database.update('users', user.id, { lname: \"Doe\" })\n\t\n\t// set user (used for complete overidding of object)\n\tawait database.set('users', user.id, { fname: \"John\" })\n\t\n\t// delete users\n\tawait database.delete('users', user.id)\n\t\n\t// delete alias\n\tawait database.remove('users', user.id)\n  \n})()\n\n```\n\n### Multiple Instances\n\n```js\n\nconst database = require('@fwd/database')('local', {\n\tnamespace: 'my_app'\n})\n\nconst database2 = require('@fwd/database')('local', {\n\tnamespace: 'another_app'\n})\n\n```\n\n## 🤝 Contributing\n\nGive a ⭐️ if this project helped you!\n\nContributions, issues and feature requests are welcome! Feel free to check [issues page](https://github.com/fwd/database/issues).\n\n## 📝 License\n\nMIT License\n\nCopyright © [nano2dev](https://twitter.com/nano2dev).\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\n## Stargazers\n\n[![Stargazers over time](https://starchart.cc/fwd/database.svg)](https://starchart.cc/fwd/database)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwd%2Fdatabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwd%2Fdatabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwd%2Fdatabase/lists"}