Problem with backslash
First, thanks for the great library! Made my life much easier and is working great.
I did however run recently into one issue. It is illustrated here:
const tmpl = require('riot-tmpl');
tmpl.brackets.set('{{ }}');
tmpl.tmpl('C:\\User\\{{name}}.txt', {name: 'frank'});
The output here is: 'C:\\User{{name}}.txt'
but I would have expected: 'C:\\User\\frank.txt'
Can that be fixed with some configuration? Is it expected behavior or simply a bug?
Thank you @janober the backslash is used to escape the expressions that's why the \\{{name}} is not properly interpolated. I don't know if there is any way to solve this issue in a clean way maybe @aMarCruz could give us an hint. However this library is no longer maintained since it was used only in Riot.js 2 and 3. I would recommend to use the template literal for your use case, for example:
const renderPath = ({ name }) => `C:\\User\\${name}.txt`
renderPath({ name: 'frank' })
@janober , please try with C:\\User\\\\{{name}}.txt