AK-21/Graphite-Industrial-Intelligence
0
1# expand-template2 3> Expand placeholders in a template string.4 5[](https://www.npmjs.com/package/expand-template)67[](https://travis-ci.org/ralphtheninja/expand-template)8[](https://standardjs.com)9 10## Install11 12```13$ npm i expand-template -S14```15 16## Usage17 18Default functionality expands templates using `{}` as separators for string placeholders.19 20```js21var expand = require('expand-template')()22var template = '{foo}/{foo}/{bar}/{bar}'23console.log(expand(template, {24 foo: 'BAR',25 bar: 'FOO'26}))27// -> BAR/BAR/FOO/FOO28```29 30Custom separators:31 32```js33var expand = require('expand-template')({ sep: '[]' })34var template = '[foo]/[foo]/[bar]/[bar]'35console.log(expand(template, {36 foo: 'BAR',37 bar: 'FOO'38}))39// -> BAR/BAR/FOO/FOO40```41 42## License43All code, unless stated otherwise, is dual-licensed under [`WTFPL`](http://www.wtfpl.net/txt/copying/) and [`MIT`](https://opensource.org/licenses/MIT).44 