es6-templater

1.1.0 • Public • Published

es6-templater

CircleCI

This is a tiny string interpolation function that mimics the es6 template literal syntax. It's a very simple function for simple use cases.

Tested on all versions of Node.js.

Usage

var template = require('es6-templater')
 
var result = template('Hello, my name is ${name}. I am from ${country}', {
  name: 'Dara',
  country: 'Ireland'
})
 
console.log(result)
// 'Hello, my name is Dara. I am from Ireland'

Linting

Usage of this module will cause standard to show Unexpected template string expression errors. This is caused by this eslint rule which can be turned off by placing the following comment at the top of your script:

/* eslint-disable no-template-curly-in-string */

Package Sidebar

Install

npm i es6-templater

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • darahayes