smaki

0.1.1 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i smaki

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • marsanla