dref
deep object refs
Last updated 13 years ago by architectd .
Repository · Original npm · Tarball · package.json
$ cnpm install dref 
SYNC missed versions from official npm registry.

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"]

Current Tags

  • 0.1.2                                ...           latest (13 years ago)

10 Versions

  • 0.1.2                                ...           13 years ago
  • 0.1.1                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
  • 0.0.6                                ...           13 years ago
  • 0.0.5                                ...           13 years ago
  • 0.0.4                                ...           13 years ago
  • 0.0.3                                ...           13 years ago
  • 0.0.2                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
  • 0.0.0                                ...           14 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 8
Last Month 1
Dependencies (3)
Dev Dependencies (2)
Dependents (5)

Copyright 2013 - present © cnpmjs.org | Home |