New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

readstream

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

readstream

read Streams that have a read function

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

ReadStream

create a ReadStream

var cs = require('path/to/readStream').controlStream


fs.createReadStream('file').pipe(cs)

cs.read(50, function(err, data){
	//first 50 bytes are available in data
	
})

move to a certain location

cs.curser = 100
cs.read(50, function(err, data){
	//read bytes 100 to 150	

})	

pipe to a destination

var cs = require('path/to/readStream').controlStream

fs.createReadStream('file').pipe(cs).pipe(dest)

pipe to multiple destinations

var cs = require('path/to/readStream').controlStream

fs.createReadStream('file').pipe(cs)

cs.pipe(dest1)
cs.pipe(dest2)

describe pace and cadence of the pipe (bytes per second)

var cs = require('path/to/readStream').controlStream

fs.createReadStream('file').pipe(cs)

cs.pipe(dest1, {pace:50,cadence:1000})
//pipe at 50 bytes per second

Keywords

readable

FAQs

Package last updated on 09 Aug 2012

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