nef-fs
Version:
File system plugin for nef
64 lines (47 loc) • 1.47 kB
Markdown
[](https://travis-ci.org/CreaturePhil/nef-fs)
[](https://david-dm.org/CreaturePhil/nef-fs)
[](https://david-dm.org/CreaturePhil/nef-fs#info=devDependencies)
File system plugin for [nef](https://github.com/CreaturePhil/nef)
```
npm install nef-fs --save
```
```js
const nef = require('nef');
const nefFs = require('nef-fs');
const db = nef(nefFs('db'));
db.money.set('phil', 10);
db.money.set('some_user', db.money.get('phil') + 10);
db.seen.set('some_user', Date.now());
db.posts.set('posts', [
{ title: 'OriginDB is awesome!', body: '...', likes: 10 },
{ title: 'flexbility ', body: '...', likes: 3 },
{ title: 'something someting something', body: '...', likes: 8 }
]);
```
In `db` folder:
```js
// money.json
{
"phil": 10
}
// seen.json
{
"some_user": 1439674925906
}
// posts.json
{
"posts": [
{ "title": "OriginDB is awesome!", "body": "...", "likes": 10 },
{ "title": "flexbility ", "body": "...", "likes": 3 },
{ "title": "something someting something", "body": "...", "likes": 8 }
]
}
```
Loads in data and save function from a folder that contains JSON files.
[](LICENSE)