1 | var FetchStream = require("../lib/fetch").FetchStream;
|
2 |
|
3 | var fetch = new FetchStream("http://google.com",{
|
4 | headers:{}
|
5 | });
|
6 |
|
7 | fetch.on("data", function(chunk){
|
8 | console.log(chunk);
|
9 | });
|
10 |
|
11 | fetch.on("meta", function(meta){
|
12 | console.log(meta);
|
13 | });
|
14 |
|
15 | fetch.on("end", function(){
|
16 | console.log("END");
|
17 | });
|
18 |
|
19 | fetch.on("error", function(e){
|
20 | console.log("ERROR: " + (e && e.message || e));
|
21 | });
|
22 |
|