maxstache-stream-variable-injection

1.0.4 • Public • Published

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.

License

MIT

Package Sidebar

Install

npm i maxstache-stream-variable-injection

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

3.97 kB

Total Files

4

Last publish

Collaborators

  • taiwanhua