{"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"}],"bugs":{"url":"https://github.com/tjgq/node-stream-throttle/issues"},"_id":"stream-throttle@0.1.0","dist":{"shasum":"cf2a195d36f97352dadd07e0350160536fef5242","tarball":"http://registry-npm.ywwl.com/stream-throttle/download/stream-throttle-0.1.0.tgz","integrity":"sha512-WaZcjA/llFBhRE2DnTVKRulILPKreim9qvNMpRerMmhYD603a20OeB7e1brczqWFbKr/70dj68lvnV+NxLhzOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZM/YMGYzU5lS6ItgLS0+Jz3UCF6izNCIfoj3IXIo9LAiB+ZpUsKx3/z4NkoaCOZF9d+rO4NlYtQW9pGuoIkWwsog=="}],"size":2588,"noattachment":false,"key":"/stream-throttle/-/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":{},"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","publish_time":1382452587964,"_cnpm_publish_time":1382452587964,"dist-tags":{"latest":"0.1.3"}}