hiccup

a sporadically choking stream; burp this baby!

npm install hiccup
12 downloads in the last week
24 downloads in the last month

Hiccup build status

Create streams that simulate slow, sloth-like behavior

Example

var stream = require("stream"),
    hiccup = require("hiccup");

// create slow stream; emits ~3 bytes every ~200 ms
var weezing = new hiccup.Throttle({bytes: 3, latency: 200});

// create a choking stream; lags for 1 s every 2 s
var koffing = new hiccup.Choke({delay: 1000, interval: 2000});

// connect streams
weezing.pipe(koffing).pipe(process.stdout);

// the weezing daydreams about meat!
weezing.write("Spare ribs ribeye pancetta meatball ham hock tongue fatback \
drumstick tenderloin. Cow ribeye turducken, pancetta short loin shoulder \
pork belly venison biltong. Capicola ball tip venison kielbasa cow \
hamburger shankle biltong beef shank frankfurter pastrami pork chicken.\n\n");

weezing.write("Meatball turducken ribeye pastrami, chuck turkey sirloin. \
Venison capicola rump pork loin. Flank frankfurter bacon capicola.\n\n");
npm loves you