es6-templater

A very simple string interpolate function.


Keywords
string, interpolate, template, es6, templating
License
MIT
Install
npm install es6-templater@1.1.0

Documentation

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.

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 */