npm.io
1.1.1 • Published 10 years ago

@f/get-prop

Licence
MIT
Version
1.1.1
Deps
1
Vulns
0
Weekly
0
Stars
4

get-prop

Build status Git tag NPM version Code style

Get nested property from object.

Installation

$ npm install @f/get-prop

Usage

var getProp = require('@f/get-prop')

var obj = {foo: {bar: 'baz'}}
getProp('foo.bar', obj) // => 'baz'

API

getProp(path, obj)
  • path - array or dot seperated string specifying path
  • obj - obj to retrieve property from

Returns: property

License

MIT