{"_id":"throttle","_rev":"373440","name":"throttle","description":"Node.js Transform stream that passes data through at `n` bytes per second","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"time":{"modified":"2021-07-27T06:35:31.000Z","created":"2011-01-25T03:37:43.252Z","1.0.3":"2013-03-07T19:05:06.959Z","1.0.2":"2013-02-26T22:22:40.634Z","1.0.1":"2013-02-10T20:00:38.941Z","1.0.0":"2013-02-09T03:06:52.899Z","0.0.1":"2011-01-25T03:37:43.252Z"},"users":{"roryrjb":true,"demoive":true,"dusandz":true,"hiztmine":true,"samar":true,"skriglitz":true,"legaphy":true},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-throttle.git"},"versions":{"1.0.3":{"name":"throttle","description":"Node.js Transform stream that passes data through at `n` bytes per second","version":"1.0.3","repository":{"type":"git","url":"git://github.com/TooTallNate/node-throttle.git"},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"main":"./throttle","scripts":{"test":"mocha --reporter spec"},"engines":{"node":">= v0.8.0"},"dependencies":{"stream-parser":">= 0.0.2","readable-stream":">= 0.3.0"},"devDependencies":{"mocha":"*"},"readmeFilename":"README.md","_id":"throttle@1.0.3","dist":{"shasum":"8a32e4a15f1763d997948317c5ebe3ad8a41e4b7","size":3980,"noattachment":false,"key":"/throttle/-/throttle-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttle/download/throttle-1.0.3.tgz"},"_from":".","_npmVersion":"1.2.12","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1362683106959,"_cnpm_publish_time":1362683106959,"_hasShrinkwrap":false},"1.0.2":{"name":"throttle","description":"Node.js Transform stream that passes data through at `n` bytes per second","version":"1.0.2","repository":{"type":"git","url":"git://github.com/TooTallNate/node-throttle.git"},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"main":"./throttle","scripts":{"test":"mocha --reporter spec"},"engines":{"node":">= v0.8.0"},"dependencies":{"stream-parser":">= 0.0.2","readable-stream":">= 0.3.0"},"devDependencies":{"mocha":"*"},"readmeFilename":"README.md","_id":"throttle@1.0.2","dist":{"shasum":"3da4cbfc9120611fa2c82ca2738a14c21a9d7700","size":3888,"noattachment":false,"key":"/throttle/-/throttle-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttle/download/throttle-1.0.2.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1361917360634,"_cnpm_publish_time":1361917360634,"_hasShrinkwrap":false},"1.0.1":{"name":"throttle","description":"Node.js Transform stream that passes data through at `n` bytes per second","version":"1.0.1","repository":{"type":"git","url":"git://github.com/TooTallNate/node-throttle.git"},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"main":"./throttle","scripts":{"test":"mocha --reporter spec"},"engines":{"node":">= v0.8.0"},"dependencies":{"stream-parser":">= 0.0.2"},"devDependencies":{"mocha":"*","readable-stream":"*"},"readmeFilename":"README.md","_id":"throttle@1.0.1","dist":{"shasum":"e2c260dbe780f38f4e7c515dbb122622d4897c5a","size":3841,"noattachment":false,"key":"/throttle/-/throttle-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttle/download/throttle-1.0.1.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1360526438941,"_cnpm_publish_time":1360526438941,"_hasShrinkwrap":false},"1.0.0":{"name":"throttle","description":"Node.js Transform stream that passes data through at `n` bytes per second","version":"1.0.0","repository":{"type":"git","url":"git://github.com/TooTallNate/node-throttle.git"},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"main":"./throttle","scripts":{"test":"mocha --reporter spec"},"engines":{"node":">= v0.8.0"},"dependencies":{"stream-parser":">= 0.0.2"},"devDependencies":{"mocha":"*"},"readmeFilename":"README.md","_id":"throttle@1.0.0","dist":{"shasum":"5f643d18d302d6d94c8666460fd8fa5f4dbbe3c6","size":3056,"noattachment":false,"key":"/throttle/-/throttle-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttle/download/throttle-1.0.0.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1360379212899,"_cnpm_publish_time":1360379212899,"_hasShrinkwrap":false},"0.0.1":{"name":"throttle","description":"Throttle node Stream instances with \"bytes per second\".","version":"0.0.1","repository":"git://github.com/TooTallNate/node-throttle.git","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"main":"./throttle","scripts":{"test":"expresso test/test*.js"},"engines":{"node":"*"},"_id":"throttle@0.0.1","_engineSupported":true,"_npmVersion":"0.2.16","_nodeVersion":"v0.3.6-pre","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"ef37b232bbe3d8621a00e8607ddcb8902e0621d0","size":1242,"noattachment":false,"key":"/throttle/-/throttle-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttle/download/throttle-0.0.1.tgz"},"publish_time":1295926663252,"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_cnpm_publish_time":1295926663252,"_hasShrinkwrap":false}},"readme":"node-throttle\n=============\n### Node.js Transform stream that passes data through at `n` bytes per second\n[![Build Status](https://secure.travis-ci.org/TooTallNate/node-throttle.png)](http://travis-ci.org/TooTallNate/node-throttle)\n\nThis module offers a `Throttle` passthrough stream class, which allows you to\nwrite data to it and it will be passed through in `n` bytes per second. It can\nbe useful for throttling HTTP uploads or to simulate reading from a file in\nreal-time, etc.\n\n\nInstallation\n------------\n\n``` bash\n$ npm install throttle\n```\n\n\nExample\n-------\n\nHere's an example of throttling stdin at 1 byte per second and outputting the\ndata to stdout:\n\n``` js\nvar Throttle = require('throttle');\n\n// create a \"Throttle\" instance that reads at 1 bps\nvar throttle = new Throttle(1);\n\nprocess.stdin.pipe(throttle).pipe(process.stdout);\n```\n\nWe can see it in action with the `echo` command:\n\n![](http://f.cl.ly/items/2h1I2Q0m3x1I2s2r2O3R/throttle.opt.gif)\n\n\nAPI\n---\n\n  - [Throttle()](#throttle)\n\n## Throttle()\n\nThe `Throttle` passthrough stream class is very similar to the node core\n`stream.Passthrough` stream, except that you specify a `bps` \"bytes per\nsecond\" option and data *will not* be passed through faster than the byte\nvalue you specify.\n\nYou can invoke with just a `bps` Number and get the rest of the default\noptions. This should be more common:\n\n``` js\nprocess.stdin.pipe(new Throttle(100 * 1024)).pipe(process.stdout);\n```\n\nOr you can pass an `options` Object in, with a `bps` value specified along with\nother options:\n\n``` js\nvar t = new Throttle({ bps: 100 * 1024, chunkSize: 100, highWaterMark: 500 });\n```\n","_attachments":{},"readmeFilename":"README.md"}