clock-stream
A duplex stream that holds onto data until it receives a "pulse." Perfect for rationing pipes on a schedule.
Example
var CS = var stream = streamstream //Some other stuff stream //Will fire readable var threeAtATime = 3threeAtATimethreeAtATime threeAtATime //<Buffer 01 02 03>threeAtATime //<Buffer 04> //Pulse is meant to be used in conjunction with EventEmitter#on//midi-clock, for instance, can be used for metronome-esque functionalityvar MidiClock = var clock = clock
API
In addition to the normal duplex stream methods, clock-stream offers:
var CS = require('clock-stream')
Main class for clock-stream
var stream = new CS([pulsesize])
Create a new stream, optionally specifying how many bytes to feed on each pulse
stream.pulse()
Feed the previously specified number of bytes through the stream, or all currently queued data if no size was specified.
See also
License
MIT