@drstrain/database

1.0.1 • Public • Published


A fast, scalable in-memory for key-value database that support multiple features:

  • Zero dependency
  • 100% test coverage
  • Security guaranteed
  • Has simple synchronous API
  • Supported namespace for your database

Install

# using npm
npm install --save @drstrain/database

# using yarn
yarn add @drstrain/database

Example usage

Create a new Database instance.

const { Database } = require('@drstrain/database');
const db = new Database();

Create a new Database instance with namespace supported. Database will be stored as ${name_space}_${key}-value

const { Database } = require('@drstrain/database');
const db = new Database('session');

Storing data to key.

const data = {
  username: 'drstrain',
  secret: {
    notes: [],
    key: 'somesecret',
  }
}
db.set('key', data);

Querying data from key string.

const val = db.get('key');
console.log(val);

Clear database

const val = db.clear();
console.log(val);

License

Licensed under MIT

Thank you

By using this product, thank you for your support!

/@drstrain/database/

    Package Sidebar

    Install

    npm i @drstrain/database

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    53.1 kB

    Total Files

    10

    Last publish

    Collaborators

    • silversoul