云盘
志元云盘
备份云盘
Home
/
志元云盘
/
webdav
/
sync
/
react
/
cockpit-modbus
/
node_modules
/
expand-template
File
OriginalPic
Thumbnails
CopyAllDownloadUrl
EditTime
Size
index.js
2025-04-30 13:33:20
672 B
LICENSE
2025-04-30 13:33:20
1.06 KB
package.json
2025-04-30 13:33:19
647 B
README.md
2025-04-30 13:33:20
1.17 KB
test.js
2025-04-30 13:33:20
1.72 KB
# expand-template > Expand placeholders in a template string. [](https://www.npmjs.com/package/expand-template)  [](https://travis-ci.org/ralphtheninja/expand-template) [](https://standardjs.com) ## Install ``` $ npm i expand-template -S ``` ## Usage Default functionality expands templates using `{}` as separators for string placeholders. ```js var expand = require('expand-template')() var template = '{foo}/{foo}/{bar}/{bar}' console.log(expand(template, { foo: 'BAR', bar: 'FOO' })) // -> BAR/BAR/FOO/FOO ``` Custom separators: ```js var expand = require('expand-template')({ sep: '[]' }) var template = '[foo]/[foo]/[bar]/[bar]' console.log(expand(template, { foo: 'BAR', bar: 'FOO' })) // -> BAR/BAR/FOO/FOO ``` ## License All code, unless stated otherwise, is dual-licensed under [`WTFPL`](http://www.wtfpl.net/txt/copying/) and [`MIT`](https://opensource.org/licenses/MIT).
2025-08-30 01:36:31 Saturday 216.73.216.167 Runningtime:0.02s Mem:1.48 MB