Skip to content

Instantly share code, notes, and snippets.

@fengmk2
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fengmk2/752f21818357f404c455 to your computer and use it in GitHub Desktop.
Save fengmk2/752f21818357f404c455 to your computer and use it in GitHub Desktop.
co readable example
'use strict';
const readable = require('co-readable');
const content = yield readable.all(fs.createReadStream('bigfile'));
'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