{"id":49345443,"url":"https://github.com/karthikeyan-ks/napi-redis","last_synced_at":"2026-04-27T07:02:48.032Z","repository":{"id":345764178,"uuid":"1186631077","full_name":"karthikeyan-ks/napi-redis","owner":"karthikeyan-ks","description":"A high-performance Redis abstraction library that implements a normalized cache strategy. By decoupling URL route paths from actual resource data, it eliminates data redundancy and ensures atomic updates across multiple endpoints.[DEVELOPMENT]","archived":false,"fork":false,"pushed_at":"2026-03-28T16:17:07.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T17:53:04.893Z","etag":null,"topics":["normalization-database","redis"],"latest_commit_sha":null,"homepage":"","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/karthikeyan-ks.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-19T20:39:43.000Z","updated_at":"2026-03-28T16:16:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/karthikeyan-ks/napi-redis","commit_stats":null,"previous_names":["karthikeyan-ks/napi-redis"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/karthikeyan-ks/napi-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karthikeyan-ks%2Fnapi-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karthikeyan-ks%2Fnapi-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karthikeyan-ks%2Fnapi-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karthikeyan-ks%2Fnapi-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karthikeyan-ks","download_url":"https://codeload.github.com/karthikeyan-ks/napi-redis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karthikeyan-ks%2Fnapi-redis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32326125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":["normalization-database","redis"],"created_at":"2026-04-27T07:02:47.834Z","updated_at":"2026-04-27T07:02:48.017Z","avatar_url":"https://github.com/karthikeyan-ks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# napi-redis [IN DEVELOPEMENT]\n\nA lightweight **normalized data layer on top of Redis** for Node.js.\nThink of it as a minimal ORM-like wrapper that brings structure, indexing, and relationships to Redis.\n\n---\n\n## ✨ Why napi-redis?\n\nRedis is fast, but working with raw commands can get messy when your data grows.\n\n`napi-redis` helps you:\n\n* Organize data into **collections (like tables)**\n* Store structured data using **hashes**\n* Query using **indexes**\n* Model simple **relationships**\n* Avoid repeated JSON parsing/stringifying\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install napi-redis\n```\n\n---\n\n## 🚀 Quick Start\n\n```js\nimport NapiRedis from \"napi-redis\";\n\nconst db = new NapiRedis(\"redis://localhost:6379\");\n\nawait db.connect();\n\n// insert data\nawait db.insert(\"users\", {\n  id: \"1\",\n  name: \"Karthikeyan\",\n  deptId: \"10\"\n});\n\n// fetch by id\nconst user = await db.findById(\"users\", \"1\");\nconsole.log(user);\n\n// query using index\nconst users = await db.find(\"users\", { name: \"Karthikeyan\" });\nconsole.log(users);\n```\n\n---\n\n## 🧠 Core Concepts\n\n### 1. Collections\n\nData is grouped into collections (like tables):\n\n```\nusers:1\nusers:2\ndepartments:10\n```\n\n---\n\n### 2. Hash-based Storage\n\nEach record is stored as a Redis hash:\n\n```\nHSET users:1 name \"Karthikeyan\" deptId \"10\"\n```\n\n---\n\n### 3. Indexing\n\nIndexes are stored using Redis sets:\n\n```\nusers:index:name:Karthikeyan → [1, 5, 9]\n```\n\nThis allows fast lookup without scanning all keys.\n\n---\n\n### 4. Relationships\n\nYou can store references between collections:\n\n```js\n{\n  id: \"1\",\n  name: \"Karthikeyan\",\n  deptId: \"10\"\n}\n```\n\nFuture versions will support automatic relation resolution.\n\n---\n\n## 📚 API (v1)\n\n### `connect()`\n\nConnect to Redis.\n\n### `insert(collection, data)`\n\nInsert a record.\n\n### `findById(collection, id)`\n\nGet a single record by ID.\n\n### `find(collection, query)`\n\nQuery records using indexed fields.\n\n---\n\n## ⚙️ Example\n\n```js\nawait db.insert(\"departments\", {\n  id: \"10\",\n  name: \"Computer Science\"\n});\n\nconst dept = await db.findById(\"departments\", \"10\");\n```\n\n---\n\n## 🔥 Roadmap\n\n* [ ] Schema definition\n* [ ] Automatic indexing\n* [ ] Relationship population (`include`)\n* [ ] TTL support\n* [ ] In-memory fallback (when Redis is down)\n* [ ] TypeScript support\n\n---\n\n## ⚠️ Notes\n\n* This is an early version (v1)\n* Not intended as a full replacement for relational databases\n* Best suited for caching layers, lightweight data storage, and fast lookups\n\n---\n\n## 🤝 Contributing\n\nFeel free to open issues or submit PRs:\nhttps://github.com/karthikeyan-ks/napi-redis\n\n---\n\n## 📄 License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarthikeyan-ks%2Fnapi-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarthikeyan-ks%2Fnapi-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarthikeyan-ks%2Fnapi-redis/lists"}