@drstrain/database
v1.0.1
Published
Fast, scalable in-memory database
Downloads
3
Readme
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!