0.1.1 • Published 9 years ago

smaki v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Smaki JSON

Interact with json object like a database

Installation

$ npm install smaki

Basic usage

var Smaki = require('smaki');

var json = {
    "a": 1,
    "b": 2
};

var smaki = new Smaki(json);

API

Compress

Compress and minify the json:

smaki.compress();
// => a|b^1|2^^$0|2|1|3]

Uncompress

Uncompress a minified json:

smaki.uncompress();

Get

Get value:

smaki.get(key);

Get Objects

Get objects:

smaki.getObjects([key], [value], [objects]);

Get Paths

Get paths:

smaki.getObjects([key], [val], [obj], [stringify], [path]);

Get Values

Get values:

smaki.getValues(key, [obj]);

Get Keys

Get keys:

smaki.getKeys(value, [obj]);

Delete

Delete objects:

smaki.deleteObject(key, [value], [obj]);

Update

Update objects:

smaki.updateObject(key, value, [oldValue], [obj]);

License

MIT


Marcos Sanz Latorre copyright 2116 marcos.sanz@13genius.com