people
v1.0.0
Published
Populate a JSON object, save it, change it, send it, validate it, and more
Downloads
14
Readme
People
Manage an Object's population.
Installation
npm install people
Usage
var People = require('people');
var target = {};
People.set(target, 'foo/bar/baz', 'boom');
target
is now:
{
foo: {
bar: {
baz: 'boom'
}
}
}
To get:
People.get(target, 'foo/bar/baz');
Returns boom
.
Path format
Default is to use /
as a path separator.
If you'd like to use another separator, use separate
:
People.separate('.');
People.get(target, 'foo/bar/baz');
// not found
People.get(target, 'foo.bar.baz');
// 'boom'