npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

streamf

1.0.0

@juliangruber

npmHomeRepoSnykSocket
Downloads:5
$ npm install streamf
DailyWeeklyMonthlyYearly

streamf

Like sprintf but for streams.

Example

var streamf = require('streamf');


streamf('foo: %s, bar: %j', someRawStream, someJSONStream))
.pipe(process.stdout)

Given someRawStream emits "bar" and someJSONStream emits {beep:"boop"}, the output will be:

foo: bar, bar: [{"beep":"boop"}]

Installation

$ npm install streamf

API

streamf(str, ..args)

Given printf style string str, render using args.

Supported placeholders:

  • %s: stringify
  • %d: numberify
  • %j: json-parse-ify

You can pass streams and normal values as args.

License

MIT