{"id":20504263,"url":"https://github.com/litingyes/jsondb","last_synced_at":"2026-05-08T15:02:29.599Z","repository":{"id":137043134,"uuid":"502618235","full_name":"litingyes/jsondb","owner":"litingyes","description":"A simple and lightweight JSON file database","archived":false,"fork":false,"pushed_at":"2023-05-25T16:25:17.000Z","size":34,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-08T19:04:58.888Z","etag":null,"topics":["curd","database","db","file","json","local","storage","store"],"latest_commit_sha":null,"homepage":"","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/litingyes.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":"2022-06-12T13:05:36.000Z","updated_at":"2023-03-07T04:02:48.000Z","dependencies_parsed_at":"2024-04-05T14:29:11.194Z","dependency_job_id":"1828019c-e151-4784-8d68-91e84da97a3c","html_url":"https://github.com/litingyes/jsondb","commit_stats":null,"previous_names":["litingyes/jsondb","liting-yes/jsondb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/litingyes/jsondb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fjsondb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fjsondb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fjsondb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fjsondb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litingyes","download_url":"https://codeload.github.com/litingyes/jsondb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litingyes%2Fjsondb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273826395,"owners_count":25175232,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"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":["curd","database","db","file","json","local","storage","store"],"created_at":"2024-11-15T19:37:08.523Z","updated_at":"2026-05-08T15:02:24.554Z","avatar_url":"https://github.com/litingyes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JsonDB\r\n\r\nA simple and lightweight JSON file database\r\n\r\n## Installtion\r\n\r\n```sh\r\nnpm i @liting-yes/jsondb\r\n```\r\n\r\n## Hello JsonDB\r\n\r\n```js\r\nconst JsonDB = require('@liting-yes/jsondb')\r\n```\r\n\r\n### Create Database\r\n\r\n```js\r\n/**\r\n * \r\n * @param {string} pathDB the absolute path of the database\r\n */\r\nconst db = new JsonDB(pathDB)\r\n```\r\n\r\n### Create a jsondb file\r\n\r\n```js\r\n/**\r\n * \r\n * @param {string} filePath the relative path of the new database file to the database\r\n * @param {any | undefined} data database file initialization data, default data is {}\r\n */\r\ndb.create(filePath, data)\r\n```\r\n\r\n### Delete a jsondb file\r\n\r\n```js\r\n/**\r\n * \r\n * @param {string} filePath the relative path of the database file witch will be deleted to database\r\n */\r\ndb.delete(filePath)\r\n```\r\n\r\n### Update data\r\n\r\n```js\r\n/**\r\n * \r\n * @param {any} data updated data\r\n * @param {array | undefined} nestedKey where the data is updated\r\n * @param {string | undefined} filePath the relative path of the updated data file to the database \r\n */\r\ndb.update(data, nestedKey, filePath)\r\n```\r\n\r\n### Query data\r\n\r\n```js\r\n/**\r\n * \r\n * @param {array | undefined} nestedKey where to query data\r\n * @param {string | undefined} filePath the relative path from the database file for data query to the database\r\n * @returns queried data\r\n */\r\ndb.query(nestedKey, filePath)\r\n```\r\n\r\n### Query keys\r\n\r\n```js\r\n/**\r\n * \r\n * @param {array | undefined} nestedKey where to query the data keys\r\n * @param {string | undefined} filePath the relative path from the database file for keys query to the database\r\n * @returns queryed keys array\r\n */\r\ndb.queryKeys(nestedKey, filePath)\r\n```\r\n\r\n### Public property\r\n\r\n- `db.pathDB`: the database absolute path\r\n- `db.currentFilePath`: the absolute path of the current database file\r\n- `db.relativePath`: the relative path of the current database file to the database (support setter)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitingyes%2Fjsondb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitingyes%2Fjsondb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitingyes%2Fjsondb/lists"}