readstream

0.0.1 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    24
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    24

Package Sidebar

Install

npm i readstream

Weekly Downloads

22

Version

0.0.1

License

none

Last publish

Collaborators

  • TimTheToolman