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
- Host: GitHub
- URL: https://github.com/webreflection/backtick-template
- Owner: WebReflection
- License: mit
- Created: 2017-01-16T13:40:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-03-13T20:47:00.000Z (over 3 years ago)
- Last Synced: 2025-04-07T10:38:35.743Z (6 months ago)
- Topics: es3, es5, string, template, transformer
- Language: JavaScript
- Size: 27.3 KB
- Stars: 32
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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 [](http://travis-ci.org/WebReflection/backtick-template) [](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