0.0.3 • Published 10 years ago

json-build v0.0.3

Weekly downloads
11
License
-
Repository
github
Last release
10 years ago

json-build

Small library to create JSON objects from expresions

Installation

npm install json-build

Usage

var json-build = require('json-build');

var entity = new json-build();
entity.addValue('first.second', 'value')
      .addValue('first.third.fourth', 'value').
      .pushValue('first.fifth', 1)
      .pushValue('first.fifth', 2)
      .build();

The result will be

{
  "first": {
    "second": "value",
    "third": {
      "fourth": "value"
    },
    "fifth": [1, 2]
  }
}

In addition, an object can be passed as argument to the constructor to be used as base object to build upon.

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago