Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
async writes
var fs = require('fs'),
http = require('http');
var out = fs.createWriteStream('some-file', {flags:'w',encoding:'utf8'});
http.createServer(function(req, res){
var buffer = [];
req.on('data', [].push.bind(buffer)).on('end', function(){
out.write(data);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.