{"id":19256514,"url":"https://github.com/instant-dev/kv","last_synced_at":"2026-02-11T12:36:35.880Z","repository":{"id":206123619,"uuid":"715878667","full_name":"instant-dev/kv","owner":"instant-dev","description":"Manage multiple Redis connections easily","archived":false,"fork":false,"pushed_at":"2026-02-04T00:57:35.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-04T12:56:49.897Z","etag":null,"topics":[],"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/instant-dev.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,"zenodo":null}},"created_at":"2023-11-08T02:29:15.000Z","updated_at":"2026-02-04T00:57:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"6686ed72-638a-4206-b4d6-f3025044ab26","html_url":"https://github.com/instant-dev/kv","commit_stats":null,"previous_names":["instant-dev/kv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/instant-dev/kv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fkv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fkv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fkv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fkv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instant-dev","download_url":"https://codeload.github.com/instant-dev/kv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fkv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29333096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-09T19:06:01.410Z","updated_at":"2026-02-11T12:36:35.859Z","avatar_url":"https://github.com/instant-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instant KV\n\n![travis-ci build](https://travis-ci.org/instant-dev/kv.svg?branch=main)\n![npm version](https://img.shields.io/npm/v/@instant.dev/kv?label=)\n\n## Manage multiple Redis connections easily\n\nInstant KV is a simple wrapper for Redis, specifically the\n[node-redis](https://github.com/redis/node-redis) client, that allows you to\nwork with JSON by default, easily manage multiple connections and gracefully\nhandle request timeouts.\n\nIt is intended to provide idiomatic kv management to\n[Instant API](https://github.com/instant-dev/api) projects.\n\n## Getting Started\n\n### Quickstart\n\nIf you are using the [Instant CLI](https://github.com/instant-dev/instant) the fastest\nway to get started is built-in;\n\n```shell\ninstant kit kv\n```\n\nThis will;\n- Install `@instant.dev/kv`\n- Set up your local `.env` with `MAIN_KV_CONNECTIONSTRING`\n- Configure `./_instant/kv.json` automatically with `{\"development\":{\"main\":{...}}}` settings\n- Extend `Instant` with an `Instant.kv` object via a plugin\n- Automatically add tests to make sure everything works\n\nVoila! Now you can use Instant KV in an Instant project;\n\n```javascript\n// Using the InstantORM extension\nconst InstantORM = require('@instant.dev/orm');\nconst Instant = await Instant.connectToPool(); // connect to ORM, runs plugins\nawait Instant.kv.store().set('my_key', 'my_value'); // set by plugin\n\n// Or...\nconst InstantKV = require('@instant.dev/kv');\nconst kv = new InstantKV();\nawait kv.connect(); // will default to using cfg from\n                    // _instant.dev/kv.json[\"development\"][\"main\"]\n                    // where \"development\" is process.env.NODE_ENV\nawait kv.store().set('my_key', 'my_value');\n```\n\n### Custom Installation\n\nIf you want to import Instant KV in a standalone project, use;\n\n```shell\ncd my_project_dir\nnpm i @instant.dev/kv --save\n```\n\nAnd then use with;\n\n```javascript\nconst InstantKV = require('@instant.dev/kv');\nconst kv = new InstantKV();\nawait kv.connect({connectionString: process.env.REDIS_URL}); // set this yourself\nawait kv.store().set('my_key', 'my_value');\n```\n\n## API Reference\n\nConnect to your main kv;\n\n```javascript\nconst InstantKV = require('@instant.dev/kv');\nconst kv = new InstantKV();\nawait kv.connect(cfg); // connectionString: or host:, port:, user: ...\n```\n\nAccess your store;\n\n```javascript\nconst store = kv.store();\nconsole.log(store === kv.store('main')); // true, can also alias\n```\n\nConnect to multiple stores simultaneously;\n\n```javascript\nconst otherStore = await kv.addStore('other_redis_instance', cfg);\n```\n\nRun queries;\n\n```javascript\nconst store = kv.store();\nawait store.set('key', {some: \"value\"}); // default to JSON\nlet json = await store.get('key');       // will default parse JSON\n```\n\n- JSON Methods (default store and retrieve as JSON)\n  - `await store.set(key, value);` (`null` will clear)\n  - `await store.get(key, defaultValue);`\n- Raw String Methods (a bit faster, no JSON parse)\n  - `await store.setRaw(key, value)`\n  - `await store.getRaw(key, value)`\n- Buffer methods (for arbitrary encodings, files)\n  - `await store.setBuffer(key, value)`\n  - `await store.getBuffer(key, value)`\n- Clear keys\n  - `await store.clear(key)` or `store.clear([key1, key2, ...])`\n- Arbitrary commands (node-redis)\n  - `await store.command('hSet', 'key', 'field', 'value')`\n  - `let client = store.command('duplicate')` - for making a duplicate client for pub/sub\n  - These will execute any arbitrary method of [node-redis](https://github.com/redis/node-redis)\n\n\n# Acknowledgements\n\nSpecial thank you to [Scott Gamble](https://x.com/threesided) who helps run all of the front-of-house work for instant.dev 💜!\n\n| Destination | Link |\n| ----------- | ---- |\n| Home | [instant.dev](https://instant.dev) |\n| GitHub | [github.com/instant-dev](https://github.com/instant-dev) |\n| Discord | [discord.gg/puVYgA7ZMh](https://discord.gg/puVYgA7ZMh) |\n| X / instant.dev | [x.com/instantdevs](https://x.com/instantdevs) |\n| X / Keith Horwood | [x.com/keithwhor](https://x.com/keithwhor) |\n| X / Scott Gamble | [x.com/threesided](https://x.com/threesided) |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstant-dev%2Fkv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstant-dev%2Fkv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstant-dev%2Fkv/lists"}