Nearly Picked Makefiles

    compile-template

    0.3.1 • Public • Published

    NPM Version node Build Status js-standard-style

    compile-template

    📠 Micro templates for Node.js

    js template literals + node vm = profit

    Captain obvious alert: 🚨 The node vm module is not a security mechanism. Do not use untrusted code in templates.

    Installation

    Install from NPM:

    $ npm install compile-template --save

    Note: compile-template requires Node 4.0.0 or later

    Example

    const compile = require('compile-template')
     
    const template = compile('foo=${41+value}')
    const string = template({value: 1})
    assert(string === 'foo=42')
     
    const template = compile('foo=${41+value}', {value: 1})
    assert(template() === 'foo=42')

    Install

    npm i compile-template

    DownloadsWeekly Downloads

    1,110

    Version

    0.3.1

    License

    MIT

    Last publish

    Collaborators

    • dotcypress