eosdb
Serverless and flexible JSON database.
Each key in the db
object corresponds to a JSON file.
Install
$ npm install eosdb --save
Usage
var db = 'directory_name';phil = 10;some_user = Date;posts = title: 'eosdb is awesome!' body: '...' likes: 10 title: 'flexbility ' body: '...' likes: 3 title: 'something someting something' body: '...' likes: 8 ;db;
In directory_name
folder:
// money.json // seen.json // posts.json
Size
for var i = 0; i < 10; i++ i = i; console; // outputs 10
get
methods
Helper Helper get
methods are just get
methods that contains a default value
if it is not the specify type.
Why? This is so you don't have to type this everywhere in your code:
var some_amount = 10;var val = 'some_user';'some_user' = val || 0 + some_amount;
It is much easier and faster to do this:
var some_amount = 10;'some_user' = db + some_amount;
aget(file, key)
Get an array value, defaults to []
.
Parameters:
file
: String
key
: String
Returns: Array
nget(file, key)
Get a number value, defaults to 0
.
Parameters:
file
: String
key
: String
Returns: Number
sget(file, key)
Get a string value, defaults to ""
.
Parameters:
file
: String
key
: String
Returns: String
License
MIT © Phil