Skip to content

Latest commit

History

History
34 lines (26 loc) 路 1.1 KB

README.md

File metadata and controls

34 lines (26 loc) 路 1.1 KB

Tickplate - Back-tick templates for JavaScript

Testing CI Codacy Badge NPM Version NPM Downloads/Month NPM Downloads

Usage

  • Install: npm install tickplate
  • Require: const t = require('tickplate');
  • Place tag t before templated string

Examples:

const t = require('tickplate');

const data = {
  hello: 'Ave!',
  myFriend: {
    name: 'Marcus Aurelius',
    toString() {
      return this.name;
    },
  },
  positions: ['emperor', 'philosopher', 'writer'],
};

const templ = t`Example: ${'hello'} ${'myFriend'}, the great ${'positions'} of Rome`;

console.log(templ(data));