maxstache-stream-variable-injection
v1.0.4
Published
Maxstache transform stream
Downloads
2
Maintainers
Readme
maxstache-stream-variable-injection is fork from maxstache
Why?
The template {{ var }}
has been made customizable
[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![Downloads][downloads-image]][downloads-url] [![js-standard-style][standard-image]][standard-url]
[maxstache][0] transform stream. Faster and simpler than {mu,min}stache
.
Installation
$ npm install maxstache-stream-variable-injection
Usage
const maxstache = require("maxstache-stream-variable-injection");
const fs = require("fs");
fs.createReadStream("./foobar.txt")
.pipe(
maxstache(
{ name: "jjjohnny", occupation: "wizard" },
"{{\\s*([^{}\\s]+)\\s*}}"
)
)
.pipe(process.stdout);
API
transformStream = maxstache(vars)
Create a maxstache transform stream that injects an object of variables. Uses
the {{varName}}
syntax to mark variables in templates.