dget

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i dget

Weekly Downloads

48

Version

1.0.0

License

BSD-2-Clause

Last publish

Collaborators

  • shockwork