kv-client-anubhav
v1.0.0
Published
Official Node.js SDK for KV Cloud — a high-performance distributed KV store with 1M+ TPS
Maintainers
Readme
kv-nodejs-client
Official Node.js SDK for KV Cloud — a high-performance, distributed key-value store with 1M+ TPS.
Installation
npm install kv-nodejs-clientQuick Start
const { createClient } = require('kv-nodejs-client');
const client = createClient({
url: 'kv://<client_id>:<api_key>@<host>:<port>'
});
await client.connect();
await client.set('foo', 'bar'); // SET
const value = await client.get('foo'); // GET → "bar"
await client.del('foo'); // DEL
client.disconnect();Get your connection URI from the KV Cloud Dashboard after provisioning a database.
CLI
npx kv-cli -u "kv://<client_id>:<api_key>@<host>:<port>"
mydb> set hello world
OK
mydb> get hello
"world"
mydb> del hello
(integer) 1
mydb> quitAPI
| Method | Description |
|---|---|
| createClient({ url }) | Create a client from a kv:// URI |
| client.connect() | Authenticate and establish connection |
| client.get(key) | Get a value (returns null if not found) |
| client.set(key, value) | Set a key-value pair (returns "OK") |
| client.del(key) | Delete a key (returns 1 or 0) |
| client.disconnect() | Close the connection |
Options
const client = createClient({
url: 'kv://...',
caCert: '/path/to/ca.crt' // Optional: custom CA cert for TLS
});License
MIT
