vstr

1.0.1 • Public • Published

vstr

vstr means Template String.

Usage

vstr(str, data)

Demo

// single variable
vstr("Hello ${name}!", {name: "Alan Turing"})
// result:
// Hello Alan Turing!
// signle variable with upper filter
vstr("Hello ${name|upper}!", {name: "Alan Turing"})
// result:
// Hello ALAN TURING!
// signle variable with uri filter
vstr("Hello ${name|uri}!", {name: "Alan Turing"})
// result:
// Hello Alan%20Turing!
// signle variable with upper and uri filter
vstr("Hello ${name|upper|uri}!", {name: "Alan Turing"})
// result:
// Hello ALAN%20TURING!

Expression Syntax

${variable|filter1|filter2|...}

Readme

Keywords

Package Sidebar

Install

npm i vstr

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • jianru.lin