Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 600 Bytes

README.md

File metadata and controls

35 lines (29 loc) · 600 Bytes

expr-prop

Replace ${foo.baz} properties in strings

Install

$ npm install --save expr-prop

Usage

const exprProp = require('expr-prop')
var obj = {
    name: 'expr-prop',
    version: '1.0.0',
    author:{
        email: '[email protected]'
    },
    dependencies: [
        {
            module: 'prop-by-string',
            version: '^1.0.1'
        }
    ]
}

exprProp.expr('name: ${name}, email: ${author.email}', obj)
// name: expr-prop, email: [email protected]

exprProp.expr('depends: ${dependencies[0].module}', obj)
// depends: prop-by-string

License

MIT