Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compile-template

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compile-template

📠 Micro templates for Node.js

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 17 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc