Browse files

Update README.md

  • Loading branch information...
1 parent c6eeb92 commit 5b3c7b7a864c8e1108ee580febb6c19b7af858d8 @sidorares committed Aug 19, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 README.md
View
4 README.md
@@ -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.

0 comments on commit 5b3c7b7

Please sign in to comment.