{"id":15575136,"url":"https://github.com/tush-tr/nosondb","last_synced_at":"2026-05-05T09:33:21.929Z","repository":{"id":57168307,"uuid":"450937838","full_name":"tush-tr/nosondb","owner":"tush-tr","description":"A Simple , Lightweight , Efficent JSON based database for Nodejs.","archived":false,"fork":false,"pushed_at":"2022-07-01T03:28:44.000Z","size":53,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T06:16:45.747Z","etag":null,"topics":["database","db","javascript","json","nodejs","nosql","nosql-database"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@tush-tr/nosondb","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tush-tr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-22T21:17:59.000Z","updated_at":"2025-02-16T03:33:52.000Z","dependencies_parsed_at":"2022-08-29T00:10:26.396Z","dependency_job_id":null,"html_url":"https://github.com/tush-tr/nosondb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tush-tr/nosondb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tush-tr%2Fnosondb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tush-tr%2Fnosondb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tush-tr%2Fnosondb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tush-tr%2Fnosondb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tush-tr","download_url":"https://codeload.github.com/tush-tr/nosondb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tush-tr%2Fnosondb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32643742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","db","javascript","json","nodejs","nosql","nosql-database"],"created_at":"2024-10-02T18:22:16.177Z","updated_at":"2026-05-05T09:33:21.907Z","avatar_url":"https://github.com/tush-tr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://img.shields.io/github/issues/tush-tr/nosondb\"\u003e \u003cimg src=\"https://img.shields.io/github/forks/tush-tr/nosondb\"\u003e \u003cimg src=\"https://img.shields.io/github/license/tush-tr/nosondb\"\u003e \u003cimg src=\"https://img.shields.io/github/stars/tush-tr/nosondb\"\u003e \u003ca href=\"https://twitter.com/tush_tr604\" target=\"blank\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/tush_tr604?logo=twitter\u0026style=flat\" alt=\"tush_tr604\" /\u003e\u003c/a\u003e \u003cimg src=\"https://img.shields.io/github/languages/count/tush-tr/nosondb\"\u003e\n\n# nosondb\n\n\u003cimg src=\"150CC64A-5FE9-4A34-9327-8D2169DBE74F_4_5005_c.jpeg\"/\u003e\n\nA json based database you can use in your nodejs projects just by installing the package.\n\nnosondb enables you to use a json file as a database for your project.\n\n# How to use it?\n\n### Installing the package\n\n```sh\nnpm i @tush-tr/nosondb\n```\n\n### Require the package in your JS file\n\n```js\nconst nosondb = require(\"@tush-tr/nosondb\")\n```\n\n### Create a new instance from the required package\n\n```js\nconst nosondb = require(\"@tush-tr/nosondb\")\nconst nodb = new nosondb(\"db.json\") // specify your json file name you want to use as database\n```\n\n# Functionalities\n\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003eMethod\u003c/th\u003e\n\u003cth\u003eInput Arguments\u003c/th\u003e\n\u003cth\u003eReturn Value\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003egetAll\u003c/td\u003e\n\u003ctd\u003e-\u003c/td\u003e\n\u003ctd\u003e[user]\u003c/td\u003e\n\u003ctd\u003eGets a list of all users\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003egetOne\u003c/td\u003e\n\u003ctd\u003eid\u003c/td\u003e\n\u003ctd\u003euser\u003c/td\u003e\n\u003ctd\u003efinds the user with a given id\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003egetOneBy\u003c/td\u003e\n\u003ctd\u003efilters\u003c/td\u003e\n\u003ctd\u003euser\u003c/td\u003e\n\u003ctd\u003efinds one user with the given filters\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ecreate\u003c/td\u003e\n\u003ctd\u003eattributes\u003c/td\u003e\n\u003ctd\u003enull\u003c/td\u003e\n\u003ctd\u003ecreates a user with the given attributes\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eupdate\u003c/td\u003e\n\u003ctd\u003eid,attributes\u003c/td\u003e\n\u003ctd\u003enull\u003c/td\u003e\n\u003ctd\u003eupdates the user with the given id using the given attributes\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003edelete\u003c/td\u003e\n\u003ctd\u003eid\u003c/td\u003e\n\u003ctd\u003enull\u003c/td\u003e\n\u003ctd\u003edelete the user with the given id\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003erandomId\u003c/td\u003e\n\u003ctd\u003e-\u003c/td\u003e\n\u003ctd\u003eid\u003c/td\u003e\n\u003ctd\u003egenerates a random id\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ewriteAll\u003c/td\u003e\n\u003ctd\u003e-\u003c/td\u003e\n\u003ctd\u003enull\u003c/td\u003e\n\u003ctd\u003ewrites all users to a user.json file\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\n### \u003cli\u003eCreating a record\n\n```js\nawait nodb.create(data)\n```\n\n### \u003cli\u003eUpdating a record\n\n```js\nawait nodb.update(id,data)\n```\n\n\n### \u003cli\u003eDeleting a record\n\n```js\nawait nodb.delete(id)\n```\n\n### \u003cli\u003eFinding all records\n\n```js\nconst allData = await nodb.getAll();\n```\n\n### \u003cli\u003eFinding one specific record by Id\n\n```js\nconst specificData = await nodb.getOne(id)\n```\n\n### \u003cli\u003eFinding one specific record by filters\n\n```js\nconst filteredData = await nodb.getOneBy(data)\n```\n\n\n\n\n\n# Examples\n\n\n### \u003cli\u003eCreate a record\n\n```js\nconst createRecord = async ()=\u003e{\n    await nodb.create({name: \"Product1\",price: 12})\n}\n```\n\nA new object will be created inside your json file with a id field also.\n\n### \u003cli\u003eUpdate a record\n\n```js\nconst updateRecord = async ()=\u003e{\n   await nodb.update(\"800dc06c\",{name: \"Keyboard\"})\n}\n```\n\nfirst argument of update function will take your id name.\n\n### \u003cli\u003eDelete a record\n\n```js\nconst deleteRecord = async ()=\u003e{\n    await nodb.delete(\"800dc06c\")\n}\n```\n\ndelete function also requires id name.\n\n### \u003cli\u003eFind all records\n\n```js\nconst findRecords = async ()=\u003e{\n    const allData = await nodb.getAll();\n    console.log(allData)\n}\n```\n\n### \u003cli\u003eFind one specific record by Id\n\n```js\nconst findRecord = async ()=\u003e{\n    const specificData = await nodb.getOne(\"800dc06c\")\n    console.log(specificData)\n}\n```\n\n### \u003cli\u003eFind one specific record by filters\n\n```js\nconst createRecord = async ()=\u003e{\n    const filteredData = await nodb.getOneBy({name: 'Product1'})\n    console.log(filterdData)\n}\n```\n    \n### \u003cli\u003e Find some records by filters\n    \n```js\nconst fetchRecords = async ()=\u003e{\n    const filteredData = await nodb.getAllBy({name: 'Product1'})\n    console.log(filterdData)\n}    \n```\n\n# Contributing 🍻\n\nI welcome pull requests, bug fixes and issue reports. Before proposing a change, please discuss your change by raising an issue.\n\n# Maintainer 😎\n\n[Tushar Rajpoot](https://twitter.com/tush_tr604)\n\n\n## License\n\n[MIT license](LICENSE) © Tushar Rajpoot\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftush-tr%2Fnosondb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftush-tr%2Fnosondb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftush-tr%2Fnosondb/lists"}