This micro-module offers a
throttle(bytesPerSecond) Function, which is compatible
Stream instances. It can be useful for throttling HTTP uploads
or to simulate reading from a file in real-time, etc.
var throttle = require('throttle'); var bytesPerKilobyte = 1024; var unthrottle = throttle(process.stdin, 100 * bytesPerKilobyte); // "data" events from 'stdin' will only arrive at a rate of 100kbps... process.stdin.resume(); // to remove the throttling, invoke the function returned from 'throttle' unthrottle();
$ npm install throttle