Created
August 14, 2013 14:20
-
-
Save apaleslimghost/6231500 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Readable.of = (body)-> | |
new class extends Readable | |
offset: 0 | |
_read: (size)-> | |
@push body.slice @offset,@offset+size-1 | |
@offset += size-1 | |
if @offset > body.length then return @push null # end the Readable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment