deep object refs

npm install dref
80 downloads in the last day
278 downloads in the last week
1 635 downloads in the last month


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


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"]
npm loves you