string-placeholder
A small library that replaces placeholders from string templates.
API
Replacing some variable placeholders
;// My name is Bob and I am 65 years old.
or by using an array:
;// My name is Bob and I am 65 years old.
Cleaning placeholders
Using the 'clean'
option cleans up undefined placeholders.
;// Choose between: option1.
You can configure the regular expression matching gaps with the 'gap'
option.
Custom placeholders
The placeholder delimiters can be configured through the 'before'
and 'after'
options like the following:
;// My name is Bob and I am 65 years old.
Escape char
By default the escape char is '\\'
but you can configure it using the 'espace'
option.