Have ideas to improve npm?Join in the discussion! »

    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

    Install

    npm i nester

    DownloadsWeekly Downloads

    0

    Version

    0.0.5

    License

    MIT

    Last publish

    Collaborators

    • avatar