backtick-template

ES2015 backticks for ES3+ engines

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
backtick-template
3200.2.04 years ago6 years agoMinified + gzip package size for backtick-template in KB

Readme

ES2015 backticks for ES3+ engines build status Coverage Status
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