String formatting with streams. It's based on new-format
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.npmignore
README.md
index.js
package.json
test.js

README.md

stream-format

String formatting with streams. It's based on new-format

Install

$ npm install stream-format

Usage

var format = require('stream-format')
var fs = require('fs')

var index = fs.createReadStream('./index.html') // => hello world. foo: {foo}, bar: {bar}, qux: {qux}
var foo = fs.createReadStream('./foo.html') // => foo
var bar = fs.createReadStream('./bar.html') // => bar
var render = format({ foo: foo, bar: bar, qux: 'qux' });

index.pipe(render).pipe(process.stdout)
// => hello world. foo: "foo", bar: "bar", qux: "qux"