Skip to content

egoist/rocksdb

Repository files navigation

@egoist/rocksdb

A simple crate to use RocksDB in Node.js

Install

npm i @egoist/rocksdb

Usage

import {
  connect,
  setItem,
  getItem,
  getKeys,
  removeItem,
  close,
} from "@egoist/rocksdb"

async function main() {
  const db = await connect("path/to/db")
  await setItem(db, "key", "value")
  console.log(await getItem(db, "key")) // value
  console.log(await getKeys(db)) // ['key']
  await removeItem(db, "key")
  console.log(await getItem(db, "key")) // null
  await close(db)
}

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published