Wondering what’s next for npm?Check out our public roadmap! »

    dotprop

    1.2.1 • Public • Published

    dotprop Build Status

    Get property by dot notation. A short and dependable implementation.

    var getProp = require('dotprop');
    
    getProp({a: { b: { c: 1}} }, 'a.b.c') // 1
    getProp([1,2,3], 2) // 3
    getProp({}, 'a.b') // undefined
    
    // recognizes arrays too
    getProp({a: { b: { c: 1}} }, ['a', 'b', 'c']) // 1
    getProp({a: { 'b.c': 1 }}, ['a', 'b.c']) // 1

    Similar

    NPM

    Install

    npm i dotprop

    DownloadsWeekly Downloads

    4,167

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    3.42 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar
    • avatar