ct

compile-template

📠 Micro templates for Node.js

Showing:

Popularity

Downloads/wk

1.2K

GitHub Stars

2

Maintenance

Last Commit

4yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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')

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial