set-vars-by-obj

1.1.0 • Public • Published

set-vars-by-obj

Sets variables into the string from given object.

Usage

Require the package in your main.js file (index.js, app.js ect.)

require('set-vars-by-obj');

The function will be set as a method of global String object.

'The name is {{lastName}}, {{name}} {{lastName}}!'.setVarsByObj({lastName:'Bond', name: 'James'});

The result will be

The name is Bond, James Bond!

Author

Hayk Karapetyan
hakarapet@gmail.com

Licence

MIT License
https://opensource.org/licenses/MIT

Package Sidebar

Install

npm i set-vars-by-obj

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • hakarapet