{"id":24504209,"url":"https://github.com/unlbslk/cheffydb","last_synced_at":"2025-07-06T01:03:30.823Z","repository":{"id":214065285,"uuid":"735621668","full_name":"unlbslk/cheffydb","owner":"unlbslk","description":"fast, tiny, simple JSON database","archived":false,"fork":false,"pushed_at":"2024-07-14T13:30:15.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T08:27:29.581Z","etag":null,"topics":["backup","database","db","fast","json","npm","quick","simple","tiny"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cheffydb","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/unlbslk.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,"publiccode":null,"codemeta":null}},"created_at":"2023-12-25T15:22:39.000Z","updated_at":"2024-07-14T13:30:18.000Z","dependencies_parsed_at":"2024-07-14T13:29:02.362Z","dependency_job_id":"d6a5f455-93da-4dfb-a1b2-408ecfe77241","html_url":"https://github.com/unlbslk/cheffydb","commit_stats":null,"previous_names":["cfy8001/cheffydb","unlbslk/cheffydb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unlbslk/cheffydb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlbslk%2Fcheffydb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlbslk%2Fcheffydb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlbslk%2Fcheffydb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlbslk%2Fcheffydb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unlbslk","download_url":"https://codeload.github.com/unlbslk/cheffydb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlbslk%2Fcheffydb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263833412,"owners_count":23517371,"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":["backup","database","db","fast","json","npm","quick","simple","tiny"],"created_at":"2025-01-21T23:22:06.134Z","updated_at":"2025-07-06T01:03:30.630Z","avatar_url":"https://github.com/unlbslk.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\r\n\t\u003cbr /\u003e\r\n\t\u003cp\u003e\r\n\t\u003cimg src=\"https://i.hizliresim.com/9npiku8.png\" width=\"500\" alt=\"CheffyDB\" /\u003e\u003c/a\u003e\r\n\t\u003c/p\u003e\r\n\t\u003cbr /\u003e\r\n\t\u003cp\u003e\r\n\t\u003ca href=\"https://www.npmjs.com/package/cheffydb\"\u003e\u003cimg src=\"https://img.shields.io/badge/NPM-%23CB3837.svg?style=flat-square\u0026logo=npm\u0026logoColor=white\" alt=\"NPM\" /\u003e\u003c/a\u003e\r\n\t\u003ca href=\"https://github.com/unlbslk/cheffydb\"\u003e\u003cimg src=\"https://img.shields.io/badge/GitHub-%23121011.svg?style=flat-square\u0026logo=github\u0026logoColor=white\" alt=\"GitHub\" /\u003e\u003c/a\u003e\r\n\t\u003cimg src=\"https://img.shields.io/badge/Discord-%235865F2.svg?style=flat-square\u0026logo=discord\u0026logoColor=white\" alt=\"Discord\"/\u003e\r\n\t\u003cimg src=\"https://img.shields.io/npm/dt/cheffydb.svg?style=flat-square\" alt=\"Downloads\" /\u003e\r\n\t\u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\n# CheffyDB\r\n**CheffyDB** is a fast, tiny, simple JSON database package with backup system.\r\n\r\n## 🧭 How To Use\r\n```\r\nnpm install cheffydb\r\n```\r\nA database file named `cheffydb.json` will be created automatically (when used).\r\n\r\n## ⛳ Examples\r\n\r\n```js\r\nconst db = require(\"cheffydb\");\r\n\r\ndb.set(\"test\", \"123\"); //Output: 123\r\ndb.push(\"test123\", \"a\"); //Output: [\"a\"]\r\ndb.push(\"test123\",  \"b\"); //Output: [\"a\",\"b\"]\r\ndb.add(\"number\", 3); //Output: 3\r\ndb.add(\"number\", 50); //Output: 53\r\ndb.subtract(\"number\", 10); //Output: 43\r\ndb.all(); //Output: [{ ID:'test',data:'123'},{ID:'test123',data:['a','b']},{ID:'number',data:43}]\r\ndb.delete(\"number\"); //Output: true\r\ndb.deleteAll(); //Output: true\r\n\r\ndb.get(\"test\"); //Output: [\"a\",\"b\"]\r\ndb.get(\"test123\"); //Output: 123\r\ndb.fetch(\"test\"); //Output: 123\r\ndb.check(\"test\"); //Output: true\r\ndb.has(\"test\"); //Output: true\r\n```\r\n### Import from Another Database Package/JSON File\r\n\r\n```js\r\n//from package\r\nconst db = require(\"cheffydb\");\r\nconst otherdb = require(\"exampledb\");\r\ndb.importFromDB(otherdb); //Output: true\r\n\r\n//from JSON file\r\nconst db = require(\"cheffydb\");\r\ndb.importFromJSONFile(\"./database.json\"); //Output: true\r\n```\r\n### Backing Up the Database File\r\n\r\n```js\r\nconst db = require(\"cheffydb\");\r\ndb.createBackup(\"./backup.json\"); //Automatically creates the backup file\r\n\r\ndb.loadBackup(\"./backup.json\");\r\ndb.loadBackup(\"./backup.json\", true); //true means the database file will be cleaned before the backup is loaded\r\n```\r\n\r\n### Database Encryption\r\nTo use this, put this code at the top of your main file:\r\n```js\r\nrequire(\"cheffydb\").encryption(true, \"encryption key\"); //⚠️⚠️⚠️ Do not type your key at here if you have public project.\r\n```\r\nStore your encryption key where no one can access it (you can use .env if you have in your project).\r\nReplace the `\"encryption key\"` string with `process.env.encKey` to use environment variables.\r\n```js\r\nconst db = require(\"cheffydb\");\r\n//db.encryption(mode,key);\r\ndb.encryption(true,process.env.encKey);\r\ndb.set(\"test\", \"123\");\r\ndb.encryption(false,process.env.encKey);\r\n```\r\n\r\n### ⚠️ **__WARNING__**: Store your encryption key where no one can access it (like .env in your projects). If you lose your encryption key, you may lose access to the database. __We are not responsible if your data is stolen/lost.__ This feature is experimental. It is not recommended to use this.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlbslk%2Fcheffydb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funlbslk%2Fcheffydb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlbslk%2Fcheffydb/lists"}