Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sidorares committed Aug 19, 2012
1 parent c6eeb92 commit 5b3c7b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ output:
API
---

```js
var shaper = require('shaper');
var shapeStream = shaper(byteRate, chunkRate, lowWatermark, highWatermark)

```

`byteRate` - targeted speed in bytes per second

`chunkRate` - (default is 10) - output chunk rate. If target speed is 20000 bytes per second and chunk rate is 100, you'll have 100 chunks per second stream, each 200 bytes in size (on average). Note that if input stream is slower then target, chunks are sent immideately at input rate, wich could be higher than target chunk rate. If input is 1000 chunks per second, each 10 bytes `shape(20000, 500)` should give same 1000 chunk per second x 10 bytes stream.
Expand Down

0 comments on commit 5b3c7b7

Please sign in to comment.