backtick-template

0.2.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    1,604
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    1,604
  • 0.1.1
    43
  • 0.1.0
    3

Package Sidebar

Install

npm i backtick-template

Weekly Downloads

318

Version

0.2.0

License

MIT

Unpacked Size

11.1 kB

Total Files

7

Last publish

Collaborators

  • webreflection