backtick-template
v0.2.0
Published
ES2015 backticks for ES3+ engines
Downloads
4,407
Maintainers
Readme
ES2015 backticks for ES3+ engines
var template = require('backtick-template');
// just string
const info = 'template';
`some ${info}` === template('some ${info}', {info});
// passing through a transformer
transform `some ${info}` ===
template(transform, 'some ${info}', {info});
// using it as String method
String.prototype.template = template.asMethod;
`some ${info}` === 'some ${info}'.template({info});
transform `some ${info}` ===
'some ${info}'.template(transform, {info});
MIT Style License