An open API service indexing awesome lists of open source software.

https://github.com/webreflection/backtick-template

ES2015 backticks for ES3+ engines
https://github.com/webreflection/backtick-template

es3 es5 string template transformer

Last synced: 6 months ago
JSON representation

ES2015 backticks for ES3+ engines

Awesome Lists containing this project

README

          

# Deprecated / Unmaintained

Please use [tag-params](https://github.com/WebReflection/tag-params#readme) instead.

- - -

### ES2015 backticks for ES3+ engines [![build status](https://secure.travis-ci.org/WebReflection/backtick-template.svg)](http://travis-ci.org/WebReflection/backtick-template) [![Coverage Status](https://coveralls.io/repos/WebReflection/backtick-template/badge.svg?branch=master)](https://coveralls.io/r/WebReflection/backtick-template?branch=master)

```js
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