1.0.4 • Published 2 months ago

maxstache-stream-variable-injection v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

maxstache-stream-variable-injection is fork from maxstache

Why?

The template {{ var }} has been made customizable

NPM version build status Test coverage Downloads js-standard-style

maxstache 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