Last active
August 29, 2015 14:27
-
-
Save fengmk2/752f21818357f404c455 to your computer and use it in GitHub Desktop.
co readable example
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
'use strict'; | |
const readable = require('co-readable'); | |
const content = yield readable.all(fs.createReadStream('bigfile')); | |
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
'use strict'; | |
const readable = require('co-readable'); | |
let buf; | |
const read = readable(fs.createReadStream('bigfile')); | |
while (buf = yield read(1024)) { | |
yield cloudstore.append('bigfile-key', buf); | |
} | |
yield cloudstore.finish('bigfile-key'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment