Nightly Patch Machine

    dref

    0.1.2 • Public • Published

    Features

    • Ability to deep reference an object
    • Ability to scan arrays, and return an array of values, e.g, users.$.name.

    Usage

     
    var dref = require("dref");
     
    var target = [
        {
            name: "Craig", 
            location: {
                city: "minneapolis"
            }
        },
        {
            name: "Tim", 
            location: {
                city: "St. Paul"
            }
        }
    ];
     
     
    console.log(dref.get(target, '$.name')); //["Craig", "Tim"]
    console.log(dref.get(target, '$.location.city')); //["Minneapolis", "St. Paul"]
    dref.set(target, '$.name', "BLAH");
    console.log(dref.get(target, '$.name')); //["BLAH", "BLAH"]

    Keywords

    none

    Install

    npm i dref

    DownloadsWeekly Downloads

    8,385

    Version

    0.1.2

    License

    none

    Last publish

    Collaborators

    • architectd
    • crcn