New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vrep

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vrep

Replaces variables in a string.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

vrep

Replaces variables in a string.

Installation

For using it as a library:

npm install --save vrep

For using it from the command line:

npm install -g vrep

Please note: you might need to use sudo on some systems for global install.

Library Usage Examples

var format = require("vrep").format;

var text1 = format("Hi, my name is {name} and I'm {age}.", {name: "Marc", age: "23"});
var text2 = format("Hi, my name is {1} and I'm {2}.", ["Marc", "23"]);

Use your own variable style and encode the values before insertion:

var format = require("vrep").create("[$", "]", encodeURIComponent);

var text1 = format("Hi, my name is [$name] and I'm [$age].", {name: "Marc", age: "23"});
var text2 = format("Hi, my name is [$1] and I'm [$2].", ["Marc", "23"]);

Command Line Usage Example

For echoing the result:

vrep template.txt data.json

For writing the result to file:

vrep template.txt data.json result.txt

Keywords

variables

FAQs

Package last updated on 22 Dec 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