A simple file-based database for node.
$ npm install node-simple-database
const simpleDatabase = require('node-simple-database');
(async () => {
await simpleDatabase.newDB('db');
const db = new simpleDatabase('db');
await db.set('key', 'value');
console.log(await db.get('key'));
})();
Simply creates empty directory to be used for a database
Simply creates empty directory to be used for a database
new simpleDatabase(directory)
async simpleDatabase.get(key[, options])
- raw - boolean - Weather to skip JSON.parseing the data
async simpleDatabase.set(key, value[, options])
- raw - boolean - Weather to skip JSON.stringifying the data
async simpleDatabase.listKeys()
async simpleDatabase.empty(areYouSure)
async simpleDatabase.delete(areYouSure)
simpleDatabase.getSync(key[, options])
- raw - boolean - Weather to skip JSON.parseing the data
simpleDatabase.setSync(key, value[, options])
- raw - boolean - Weather to skip JSON.stringifying the data
simpleDatabase.listKeysSync()
simpleDatabase.emptySync(areYouSure)
simpleDatabase.deleteSync(areYouSure)