UNPKG

317 BJavaScriptView Raw
1
2var co = require('..');
3var fs = require('fs');
4
5var read = co.wrap(fs.readFile);
6
7var sizes = co(function *(){
8 var a = yield read('.gitignore');
9 var b = yield read('Makefile');
10 var c = yield read('package.json');
11 return [a.length, b.length, c.length];
12});
13
14sizes(function(err, res){
15 console.log(res);
16});