Socket
Book a DemoInstallSign in
Socket

streamf

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streamf

Like sprintf but for streams

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 28 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts