nester

0.0.5 • Public • Published

nester - A nested object getter/setter

Usage:

var nester = require('nester');

var nestedObj = {a:{b:{c:{d:42}}}}
var res = nester(nestedObj, 'a.b.c.d'); // getting
console.log(res) // 42

nester(nestedObj, 'a.some.other.path[0]', 42);
console.log(nestedObj.a.some.other.path[0]); // 42

Testing:

npm install
npm test

Dependents (0)

Package Sidebar

Install

npm i nester

Weekly Downloads

0

Version

0.0.5

License

MIT

Last publish

Collaborators

  • kolodny