Socket
Socket
Sign inDemoInstall

indexed-template

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indexed-template

An indexed template processor


Version published
Maintainers
1
Created
Source

Indexed Template

Process indexed template literals.

Example

let template = require('indexed-template');

let text = template`Hello ${0}!`('Sandy');
// Hello Sandy!

let fn = template`${0} knows ${1}, and ${1} knows ${0}.`;

fn('Elizabeth', 'Francis');
fn('Jake', 'Jim');
// Elizabeth knows Francis, and Francis knows Elizabeth.
// Jake knows Jim, and Jim knows Jake.

Installation

$ npm install indexed-template

API

var template = require('indexed-template');

templatetemplate literal(...values))

  • template literal {string.raw} A template literal where each expression evaluates to an integer
  • parameter {...*} value: A value to be placed into the literal string matching the indexed value to the expressions integer.
  • returns string: A string representing the template populated with the values.

Keywords

FAQs

Package last updated on 07 Jul 2016

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