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
var wait = require('co-wait'); | |
var http = require('http'); | |
var co = require('co'); | |
co(function*(){ | |
http.createServer(function(req, res){ | |
res.end('hi') | |
}).listen(8004); | |
yield wait(1000); | |
throw new Error('foo'); |
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
gist(1) test |
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
> levelup@0.18.2 test /Users/julian/dev/rvagg/node-levelup | |
> tap test/*-test.js --stderr | |
not ok test/approximate-size-test.js .................... 0/1 | |
Command: "/usr/local/bin/node approximate-size-test.js" | |
TAP version 13 | |
not ok 1 test/approximate-size-test.js | |
--- | |
exit: ~ |
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
yield function(done){ | |
console.log('in yield'); | |
setTimeout(function(){ | |
console.log('after timeout'); | |
done(); | |
}, 0); | |
} | |
console.log('waited') |
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
foo bar |
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
foo bar |
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
foo bar | |
neat, huh? |
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
foo bar | |
neat, huh?... |
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
foo bar | |
neat, huh?... |
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
var co = require('co'); | |
var split = require('split'); | |
var thunk = require('thunkify'); | |
var pipe = thunk(require('multipipe')); | |
var read = require('co-read'); | |
var write = require('co-write'); | |
var JSONStream = require('JSONStream'); | |
co(function*(){ | |
var headerData = {}; |