Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (24 sloc) 743 Bytes


Node.js Transform stream that passes data through at n bytes per second

This module offers a Throttle passthrough stream class, which allows you to write data to it and it will be passed through in n bytes per second. It can be useful for throttling HTTP uploads or to simulate reading from a file in real-time, etc.


Here's an example of throttling stdin at 10 kb/s and outputting the data to stdout:

var Throttle = require('throttle');

// create a "Throttle" instance that reads at 10 kb/s
var kb = 1024;
var throttle = new Throttle(10 * kb);


That's it!


$ npm install throttle
Jump to Line
Something went wrong with that request. Please try again.