dotpather

dotpath lookup module

npm install dotpather
23 downloads in the last week
50 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