🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

any-stream

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

any-stream

Make any function that takes string input streamable.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

any-stream

NPM version License Build status

Make any function that takes string input (as the first argument) streamable.

Installation

npm install any-stream

Usage

API

anyStream(fn, [...args])

Make fn streamable by leveraging through2 to pass the contents of a stream first and then any consecutive arguments to it.

Example

var fs           = require('fs')
var anyStream    = require('any-stream')
var htmlMinifier = require('html-minifier').minify

var input  = fs.createReadStream('src/index.html')
var output = fs.createWriteStream('dist/index.html')

input
  .pipe(anyStream(htmlMinifier, {
    collapseWhitespace: true,
    removeComments: true
  }))
  .pipe(output)

Keywords

stream

FAQs

Package last updated on 03 May 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