A Minimal and persistent key-value database. Inspired by denokv, so it will has some similar api (but not 1-to-1 copy).
DOCS: https://codehz.github.io/nanokv
Use docker: ghcr.io/codehz/nanokv
docker run -p 2256:2256 -v /data/db:db ghcr.io/codehz/nanokv
Note: Since there is currently no security mechanism, it is not recommended to use NanoKV directly on the front end
import { NanoKV, type KvEntry, type KvQueueEntry } from "nanokv";
type EntryType =
| KvEntry<["user", id: number, "name"], string>
| KvEntry<["user", id: number, "age"], number>;
type QueueType =
| KvQueueEntry<["user-joined"], number>
| KvQueueEntry<["user-left"], number>;
const kv = new NanoKV<EntryType, QueueType>("http://127.0.0.1:2256");
await kv.set(["user", 1, "name"], "admin");
I am a user of denokv, and I think denokv is a great product, especially when used in the hosting environment provided by deno.com. Compared to other similar key-value products, it has many excellent features (such as support for atomic operations on one side).
However, I have also found some limitations of denokv, which means it does not meet my needs for some projects:
I feel that my needs may not align with the direction of denokv's product development, so I have decided to implement a substitute with similar APIs to meet my own needs.