keal
Version:
keal is key value storage
52 lines (40 loc) • 1.11 kB
Markdown
//packagephobia.now.sh/badge?p=keal)](https://packagephobia.now.sh/result?p=keal)
keal is key value storage
npm i keal --save
```javascript
const path = require('path')
const Keal = require('keal');
//initial database folder
const keal = new Keal({
databasePath: path.join(__dirname, 'database'),
databaseName: 'NASA',
});
//put with key value
keal.put('firstName', 'behnam');
keal.put('lastName', 'mohammadi');
keal.put('info', {
age: 28,
height: 175
});
//get
//output: get behnam
console.log('get', keal.get('firstName'));
//get
//output: get mohammadi
console.log('get', keal.get('lastName'));
//get
//output: get { age: 28, height: 175 }
console.log('get', keal.get('info'));
//gets
//output: gets [ 'behnam', 'mohammadi', { age: 28, height: 175 } ]
console.log('gets', keal.gets(['firstName', 'lastName', 'info']));
//get all keys
//output: keys [ 'firstName', 'lastName', 'info' ]
console.log('keys', keal.keys());
//get all values
//output: values [ 'behnam', 'mohammadi', { age: 28, height: 175 } ]
console.log('values', keal.values());
```
[![install size](https: