node-dig
v1.0.1
Published
This library enables you to access nested elements in Object.
Downloads
20
Readme
node-dig
This library enables you to access nested elements in Object.
installation
npm install --save node-dig
Usage
const dig = require('node-dig');
let object = {};
// set value
dig(object, ['a', 'b', 'c'], 10);
// { a: { b: { c: 10 } } }
console.log(object);
// get value
const value = dig(object, ['a', 'b', 'c']);
// 10
console.log(value);