UNPKG

276 BJavaScriptView Raw
1// pipe to file
2
3var FetchStream = require("../lib/fetch").FetchStream,
4 fs = require("fs"),
5 inp, out;
6
7inp = new FetchStream("http://google.com");
8out = fs.createWriteStream('google.html');
9
10inp.on("end", function(){
11 console.log("downloaded!");
12});
13
14inp.pipe(out);
\No newline at end of file