Socket
Socket
Sign inDemoInstall

tmpl

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tmpl

JavaScript micro templates.


Version published
Weekly downloads
21M
increased by2.04%
Maintainers
1
Install size
3.52 kB
Created
Weekly downloads
 

Package description

What is tmpl?

The tmpl npm package is a simple templating function that allows for the substitution of placeholders within a string template with actual values. It is lightweight and straightforward, making it suitable for small-scale templating tasks where a full-featured templating engine might be unnecessary.

What are tmpl's main functionalities?

String substitution

This feature allows for the dynamic substitution of placeholders within a string template with values from a data object. The placeholders are identified by the syntax `${placeholderName}`, and the corresponding value from the data object is inserted in its place.

`var template = 'Hello, ${name}!';
var data = {name: 'World'};
var result = tmpl(template)(data);
console.log(result); // Outputs: Hello, World!`

Other packages similar to tmpl

Readme

Source

tmpl Build Status

Simple string formatting using {}.

assert.equal(
  tmpl('the answer is {answer}', { answer: 42 }),
  'the answer is 42')

FAQs

Last updated on 07 Sep 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc