1.0.0 • Published 10 years ago

dget v1.0.0

Weekly downloads
5
License
BSD-2-Clause
Repository
github
Last release
10 years ago

dget

Build Status

Get a property from deep objects using string notation.

Installation

$ npm install dget --save

Usage

var obj, val, nonexsting;
obj = {
    some: {
        prop: {
            deep: "Hello world!"
        }
    }
}
val = dget('some.prop.deep', obj);
console.log(val); // "Hello world!"
val = dget('non.existing.prop', obj)
console.log(val); // undefined

Testing

$ npm test

License

BSD