a16758c7b5
- HTML/CSS frontend mitQuest-System und Spieler-Management - Node.js/Express backend mit SQLite database - REST API endpoints für game state, spieler, notes - AI instructions documentation - Würfelfunktionen und Tracker-UI
1.2 KiB
1.2 KiB
expand-template
Expand placeholders in a template string.
Install
$ npm i expand-template -S
Usage
Default functionality expands templates using {} as separators for string placeholders.
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:
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 and MIT.