dotpather

dotpath lookup module

npm install dotpather
8 downloads in the last week
48 downloads in the last month

dotpather

Build Status

Utility for looking up object properties based on dot-paths

usage

var dotpather = require('dotpather'),
    renderer = dotpather('whatever.route.you.want'),
    result = renderer({ whatever: { route: { you: { want: 'bingo' }}}})

console.log(result) // "bingo"

var badResults = renderer({}) || renderer() || renderer(null)

console.log(badResults); // "undefined"

license

MIT

npm loves you