{"id":14006945,"url":"https://github.com/p32929/fjsondb","last_synced_at":"2025-04-24T08:32:48.385Z","repository":{"id":167434518,"uuid":"643069409","full_name":"p32929/fjsondb","owner":"p32929","description":"A fast and simple JSON database for NodeJS","archived":false,"fork":false,"pushed_at":"2023-08-29T03:02:10.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T06:52:34.688Z","etag":null,"topics":["awesome","database","easy-to-use","fast","fjsondb","javascript","json","json-database","json-db","simple","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fjsondb","language":"TypeScript","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/p32929.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-20T02:44:49.000Z","updated_at":"2023-12-09T07:59:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7d0278a-88d7-404b-a373-9779640d8c91","html_url":"https://github.com/p32929/fjsondb","commit_stats":null,"previous_names":["p32929/fjsondb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2Ffjsondb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2Ffjsondb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2Ffjsondb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2Ffjsondb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p32929","download_url":"https://codeload.github.com/p32929/fjsondb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223947819,"owners_count":17230100,"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":["awesome","database","easy-to-use","fast","fjsondb","javascript","json","json-database","json-db","simple","typescript"],"created_at":"2024-08-10T10:01:43.465Z","updated_at":"2024-11-10T11:33:22.171Z","avatar_url":"https://github.com/p32929.png","language":"TypeScript","readme":"# fjsondb\r\n\r\nA fast and simple JSON database for NodeJS\r\n\r\n# Installation\r\n\r\n```\r\nnpm install fjsondb\r\n```\r\n\r\nor\r\n\r\n```\r\nyarn add fjsondb\r\n```\r\n\r\n# Usage\r\n\r\nFirst create an instance of Fjsondb with the location of where you'd like to save the data\r\n\r\n```\r\nconst jsonLocation = './data/test.json'\r\nconst db = new Fjsondb(jsonLocation)\r\n```\r\n\r\nAfter that, to set/save a data, use the set function like this (Literally any data type of value can be set/saved):\r\n\r\n```\r\ndb.set(\"test1\", 1)\r\ndb.set(\"test2\", \"1\")\r\ndb.set(\"test3\", true)\r\ndb.set(\"test4\", {\r\n    newKey: \"value\"\r\n})\r\ndb.set(\"key\", {\r\n    newObj: {\r\n        newKey: \"value\"\r\n    }\r\n})\r\n```\r\n\r\nTo get the data, use the get function:\r\n```\r\nconst savedValue = db.get(\"key\")\r\n```\r\n\r\nTo check, if there's a value saved, use the has function:\r\n```\r\nconst isValueAvailable = db.has(\"key\")\r\n```\r\n\r\nTo delete a value, use the delete function:\r\n```\r\ndb.delete(\"key\")\r\n```\r\n\r\nTo get the full current JSON, use getJson function:\r\n```\r\nconst jsonData = db.getJson()\r\n```\r\n\r\nTo delete all data, use the deleteAll function:\r\n```\r\ndb.deleteAll()\r\n```\r\n\r\nYou can use multiple Fjsondb instances if you want like this:\r\n```\r\nconst jsonLocation = './data/test.json'\r\nconst db = new Fjsondb(jsonLocation)\r\n\r\nconst jsonLocation2 = './data/test2.json'\r\nconst db2 = new Fjsondb(jsonLocation2)\r\n```\r\n\r\nTo increment/decrement a number:\r\n```\r\ndb.decrementNumber(\"key\")\r\n```\r\n\r\n## License\r\n\r\n```\r\nMIT License\r\n\r\nCopyright (c) 2020 Fayaz Bin Salam\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n```","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp32929%2Ffjsondb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp32929%2Ffjsondb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp32929%2Ffjsondb/lists"}