{"_id":"stream-throttle","_rev":"324779","name":"stream-throttle","description":"A rate limiter for Node.js streams.","dist-tags":{"latest":"0.1.3"},"maintainers":[{"name":"tjgq","email":"tiagoq@gmail.com"}],"time":{"modified":"2021-06-04T02:11:41.000Z","created":"2013-10-22T14:36:27.964Z","0.1.3":"2014-04-08T00:48:57.963Z","0.1.2":"2014-04-08T00:27:19.575Z","0.1.1":"2014-04-04T00:19:09.314Z","0.1.0":"2013-10-22T14:36:27.964Z"},"users":{"edin-m":true,"demoive":true,"dzuluaga":true,"quocnguyen":true,"tsxuehu":true,"tcrowe":true},"author":{"name":"Tiago Quelhas","email":"tiagoq@gmail.com"},"repository":{"type":"git","url":"http://github.com/tjgq/node-stream-throttle.git"},"versions":{"0.1.3":{"name":"stream-throttle","description":"A rate limiter for Node.js streams.","version":"0.1.3","author":{"name":"Tiago Quelhas","email":"tiagoq@gmail.com"},"license":"BSD-3-Clause","keywords":["streams","throttling","ratelimit"],"engines":{"node":">= 0.10.0"},"repository":{"type":"git","url":"http://github.com/tjgq/node-stream-throttle.git"},"main":"./index.js","scripts":{"test":"nodeunit test"},"bin":{"throttleproxy":"./bin/throttleproxy.js"},"dependencies":{"commander":"^2.2.0","limiter":"^1.0.5"},"devDependencies":{"async":"^0.6.2"},"contributors":[{"name":"Tiago Quelhas","email":"tiagoq@gmail.com"}],"bugs":{"url":"https://github.com/tjgq/node-stream-throttle/issues"},"homepage":"https://github.com/tjgq/node-stream-throttle","_id":"stream-throttle@0.1.3","dist":{"shasum":"add57c8d7cc73a81630d31cd55d3961cfafba9c3","size":4084,"noattachment":false,"key":"/stream-throttle/-/stream-throttle-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-throttle/download/stream-throttle-0.1.3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tjgq","email":"tiagoq@gmail.com"},"maintainers":[{"name":"tjgq","email":"tiagoq@gmail.com"}],"directories":{},"publish_time":1396918137963,"_cnpm_publish_time":1396918137963,"_hasShrinkwrap":false},"0.1.2":{"name":"stream-throttle","description":"A rate limiter for Node.js streams.","version":"0.1.2","author":{"name":"Tiago Quelhas","email":"tiagoq@gmail.com"},"license":"BSD-3-Clause","keywords":["streams","throttling","ratelimit"],"engines":{"node":">= 0.10.0"},"repository":{"type":"git","url":"http://github.com/tjgq/node-stream-throttle.git"},"main":"./index.js","scripts":{"test":"nodeunit test"},"bin":{"throttleproxy":"./bin/throttleproxy.js"},"dependencies":{"commander":"^2.2.0","limiter":"^1.0.5"},"devDependencies":{"async":"^0.6.2"},"contributors":[{"name":"Tiago Quelhas","email":"tiagoq@gmail.com"}],"bugs":{"url":"https://github.com/tjgq/node-stream-throttle/issues"},"homepage":"https://github.com/tjgq/node-stream-throttle","_id":"stream-throttle@0.1.2","dist":{"shasum":"337202e1c78bfcfa715a7b3cb8b34aa88d1f39a1","size":4033,"noattachment":false,"key":"/stream-throttle/-/stream-throttle-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-throttle/download/stream-throttle-0.1.2.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tjgq","email":"tiagoq@gmail.com"},"maintainers":[{"name":"tjgq","email":"tiagoq@gmail.com"}],"directories":{},"publish_time":1396916839575,"_cnpm_publish_time":1396916839575,"_hasShrinkwrap":false},"0.1.1":{"name":"stream-throttle","description":"A rate limiter for Node.js streams.","version":"0.1.1","author":{"name":"Tiago Quelhas","email":"tiagoq@gmail.com"},"license":"BSD-3-Clause","keywords":["streams","throttling","ratelimit"],"engines":{"node":">= 0.10.0"},"repository":{"type":"git","url":"http://github.com/tjgq/node-stream-throttle.git"},"main":"./index.js","scripts":{"test":"nodeunit test"},"bin":{"throttleproxy":"./bin/throttleproxy.js"},"dependencies":{"commander":"^2.2.0","limiter":"^1.0.5"},"devDependencies":{"async":"^0.6.2"},"contributors":[{"name":"Tiago Quelhas","email":"tiagoq@gmail.com"}],"bugs":{"url":"https://github.com/tjgq/node-stream-throttle/issues"},"homepage":"https://github.com/tjgq/node-stream-throttle","_id":"stream-throttle@0.1.1","dist":{"shasum":"b11ff3927a74e36ccc9647539c50bc4162a81b12","size":4045,"noattachment":false,"key":"/stream-throttle/-/stream-throttle-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-throttle/download/stream-throttle-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tjgq","email":"tiagoq@gmail.com"},"maintainers":[{"name":"tjgq","email":"tiagoq@gmail.com"}],"directories":{},"publish_time":1396570749314,"_cnpm_publish_time":1396570749314,"_hasShrinkwrap":false},"0.1.0":{"name":"stream-throttle","description":"A rate limiter for Node.js streams.","version":"0.1.0","author":{"name":"Tiago Quelhas"},"license":"BSD","main":"./index.js","repository":{"type":"git","url":"http://github.com/tjgq/node-stream-throttle.git"},"dependencies":{"limiter":"~1.0.4","commander":"~2.0.0"},"contributors":[{"name":"Tiago Quelhas","email":"tiagoq@gmail.com"}],"readmeFilename":"README.md","bugs":{"url":"https://github.com/tjgq/node-stream-throttle/issues"},"_id":"stream-throttle@0.1.0","dist":{"shasum":"cf2a195d36f97352dadd07e0350160536fef5242","size":2588,"noattachment":false,"key":"/stream-throttle/-/stream-throttle-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-throttle/download/stream-throttle-0.1.0.tgz"},"_from":"node-stream-throttle/","_npmVersion":"1.3.11","_npmUser":{"name":"tjgq","email":"tiagoq@gmail.com"},"maintainers":[{"name":"tjgq","email":"tiagoq@gmail.com"}],"directories":{},"publish_time":1382452587964,"_cnpm_publish_time":1382452587964,"_hasShrinkwrap":false}},"readme":"# stream-throttle #\n\nA rate limiter for Node.js streams.\n\n## API usage\n\nThis module exports two classes, `Throttle` and `ThrottleGroup`.\n\n`Throttle` creates a single throttled stream, based on `stream.Transform`. It accepts an `opts` parameter with the following keys:\n\n* `opts.rate` is the throttling rate, in bytes per second.\n* `opts.chunksize` (optional) is the maximum chunk size into which larger writes are decomposed; the default is `opts.rate`/10.\n\nThe `opts` object may also contain options to be passed to the `stream.Transform` constructor.\n\nFor example, the following code throttles stdin to stdout at 10 bytes per second:\n\n    process.stdin.pipe(new Throttle({rate: 10})).pipe(process.stdout)\n\n`ThrottleGroup` allows the creation of a group of streams whose aggregate bandwidth is throttled. The constructor accepts the same `opts` argument as for `Throttle`. Call `throttle` on a `ThrottleGroup` object to create a new throttled stream belonging to the group.\n\nFor example, the following code creates two HTTP connections to `www.google.com:80`, and throttles their aggregate (downstream) bandwidth to 10 KB/s:\n\n    var addr = { host: 'www.google.com', port: 80 };\n    var tg = new ThrottleGroup({rate: 10240});\n\n    var conn1 = net.createConnection(addr),\n        conn2 = net.createConnection(addr);\n\n    var thr1 = conn1.pipe(tg.throttle()),\n        thr2 = conn2.pipe(tg.throttle());\n\n    // Reads from thr1 and thr2 are throttled to 10 KB/s in aggregate\n\n## Command line usage\n\nThis package installs a `throttleproxy` binary which implements a command-line utility for throttling connections. Run `throttleproxy -h` for instructions.\n\n## Contributing\n\nFeel free to open an issue or send a pull request.\n\n## License\n\nBSD-style. See the LICENSE file.\n\n## Author\n\nCopyright © 2013 Tiago Quelhas. Contact me at `<tiagoq@gmail.com>`.\n","_attachments":{},"homepage":"https://github.com/tjgq/node-stream-throttle","bugs":{"url":"https://github.com/tjgq/node-stream-throttle/issues"},"license":"BSD-3-Clause"}