{"id":18035752,"url":"https://github.com/zyrouge/keyvify","last_synced_at":"2026-01-22T19:48:16.160Z","repository":{"id":55962365,"uuid":"308503052","full_name":"zyrouge/Keyvify","owner":"zyrouge","description":"🔑 A simple key-value database supporting various dialects","archived":false,"fork":false,"pushed_at":"2020-12-04T06:04:02.000Z","size":775,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"next","last_synced_at":"2025-03-23T10:35:31.147Z","etag":null,"topics":["database","key","mongodb","sql","value"],"latest_commit_sha":null,"homepage":"https://keyvify.js.org","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/zyrouge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"zyrouge","open_collective":null,"ko_fi":"zyrouge","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-10-30T02:23:00.000Z","updated_at":"2021-08-22T15:48:20.000Z","dependencies_parsed_at":"2022-08-15T10:20:44.372Z","dependency_job_id":null,"html_url":"https://github.com/zyrouge/Keyvify","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyrouge%2FKeyvify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyrouge%2FKeyvify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyrouge%2FKeyvify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyrouge%2FKeyvify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zyrouge","download_url":"https://codeload.github.com/zyrouge/Keyvify/tar.gz/refs/heads/next","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245809564,"owners_count":20676008,"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","key","mongodb","sql","value"],"created_at":"2024-10-30T12:09:28.033Z","updated_at":"2026-01-22T19:48:16.152Z","avatar_url":"https://github.com/zyrouge.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\r\n  \u003cimg\r\n    src=\"https://keyvify.js.org/assets/logo.png\" width=\"230px\"\u003e\r\n\u003c/p\u003e\r\n\r\n\u003ch1 align=\"center\"\u003eKeyvify\u003c/h1\u003e\r\n\u003cp align=\"center\"\u003eA simple key-value database supporting various dialects\u003c/p\u003e\r\n\r\n[![npm version](https://badgen.net/npm/v/keyvify)](https://www.npmjs.com/package/keyvify)\r\n[![npm downloads](https://badgen.net/npm/dm/keyvify)](https://www.npmjs.com/package/keyvify)\r\n\r\n## 📦 Installation\r\n\r\n```console\r\n$ npm install keyvify\r\n```\r\n\r\nand also a Dialect\r\n\r\n```console\r\n$ npm i pg pg-hstore # Postgres\r\n$ npm i mysql2 # MySQL\r\n$ npm i mariadb # MariaDB\r\n$ npm i sqlite3 # SQLite\r\n$ npm i better-sqlite3 # Better SQLite\r\n$ npm i mongoose # MongoDB\r\n$ npm i tedious # Microsoft SQL Server\r\n```\r\n\r\n## ❔ But why Keyvify?\r\n\r\n- Simple as [this](#%EF%B8%8F-basic-example)\r\n- Easy for beginners\r\n- Persistent\r\n- Promise-based\r\n- Supports [multiple databases](https://keyvify.js.org/docs/globals.html#supporteddialectsstrs)\r\n- Support for **dot notation**\r\n- Import and Export the data to a simple JSON file\r\n- Store almost anything (Refer all the types [here](https://www.npmjs.com/package/serialize-javascript))\r\n- Quick setup (When using **better-sqlite3** or **sqlite**)\r\n- In-built caching using NodeJS `Map`\r\n- Support for custom **Dialects** and **Cache** store\r\n- Typescript support\r\n- Works from NodeJS v8 (might vary)\r\n\r\n## 🤔 How does it work?\r\n\r\n- Keyvify internally uses [Better SQLite](https://www.npmjs.com/package/better-sqlite3) for SQLite, [Sequelize](https://www.npmjs.com/package/sequelize) for other SQL related-databases, [Mongoose](https://www.npmjs.com/package/mongoose) for MongoDB\r\n- Serializes all the data into `string` to store in database. Uses [sequelize-javascript](https://www.npmjs.com/package/serialize-javascript) by default due to limitation in `JSON.stringify`\r\n- Keyvify caches the data when something is `set`, `get`, `delete` and `fetch`\r\n\r\n## 📄 Documentation\r\n\r\nRefer [here](https://keyvify.js.org/docs)\r\n\r\n## 📙 Guides\r\n\r\nRefer [here](https://keyvify.js.org/guide)\r\n\r\n## ✏️ Basic Example\r\n\r\n```js\r\nconst { Keyvify } = require(\"keyvify\");\r\n\r\nconst database = Keyvify(\"my_super_awesome_database\", {\r\n  dialect: \"better-sqlite\",\r\n  storage: __dirname + \"/../database.sqlite\",\r\n});\r\n\r\nconst init = async () =\u003e {\r\n  // connect\r\n  await database.connect();\r\n\r\n  // set a data\r\n  await database.set(\"hello\", \"world\"); // returns: { key: \"hello\", value: \"world\" }\r\n\r\n  // get a data\r\n  await database.get(\"hello\"); // returns: { key: \"hello\", value: \"world\" }\r\n\r\n  // get all data (fetches from the database)\r\n  await database.all(); // returns: [{ key: \"hello\", value: \"world\" }]\r\n\r\n  // get all **cached** data (only data from `database.cache` and doesnt need await)\r\n  database.entries(); // returns: [{ key: \"hello\", value: \"world\" }]\r\n\r\n  // delete a data\r\n  await database.delete(\"hello\"); // returns: 1\r\n\r\n  // delete all\r\n  await database.truncate(); // returns: 0 (number of deleted keys)\r\n\r\n  // disconnect\r\n  await database.disconnect();\r\n};\r\n\r\ndatabase.on(\"connect\", () =\u003e console.log(\"Connected!\"));\r\ndatabase.on(\"disconnect\", () =\u003e console.log(\"Disconnected!\"));\r\ndatabase.on(\"valueSet\", (pair) =\u003e console.log(\"Some data was set:\", pair));\r\ndatabase.on(\"valueGet\", (pair) =\u003e console.log(\"Some data was got:\", pair));\r\ndatabase.on(\"valueDelete\", (key) =\u003e console.log(\"Some key was deleted:\", key));\r\ndatabase.on(\"valueUpdate\", (pair) =\u003e\r\n  console.log(\"Some data was changed:\", pair)\r\n);\r\ndatabase.on(\"valueFetch\", (pairs) =\u003e\r\n  console.log(\"All data were fetched:\", pairs)\r\n);\r\ndatabase.on(\"truncate\", (amount) =\u003e\r\n  console.log(\"Database was emptied:\", amount)\r\n);\r\n```\r\n\r\nClick [here](./examples) for more examples\r\n\r\n## 🚩 Resources\r\n\r\n- [Website](https://keyvify.js.org)\r\n- [Documentation](https://keyvify.js.org/docs)\r\n- [NPM](https://npmjs.com/keyvify)\r\n- [Discord](https://zyrouge.gq/discord)\r\n","funding_links":["https://patreon.com/zyrouge","https://ko-fi.com/zyrouge"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyrouge%2Fkeyvify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzyrouge%2Fkeyvify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyrouge%2Fkeyvify/lists"}