Created
July 17, 2014 20:06
-
-
Save kadamwhite/5f36f0ae7d805b2c9e34 to your computer and use it in GitHub Desktop.
My best time: 9ms!
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
{ | |
"name": "dream-speedrun", | |
"description": "Run through dream.js as fast as possible", | |
"main": "speedrun.js", | |
"scripts": { | |
"start": "node speedrun.js" | |
}, | |
"license": "WTFPL" | |
} |
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'; | |
var agent = require( 'superagent' ); | |
agent.get( | |
'https://raw.githubusercontent.com/incompl/dream/master/dream.js' | |
).end(function( err, result ) { | |
if ( err ) { | |
console.error( err ); | |
return; | |
} | |
var lines = result.text.split( '\n' ); | |
console.time( 'Speedrun' ); | |
lines.forEach(function( line ) { | |
console.log( line ); | |
}); | |
console.timeEnd( 'Speedrun' ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment