Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
524 bytes
|
Line | |
---|
1 | var fs = require('fs'),
|
---|
2 | stream = require('stream'),
|
---|
3 | needle = require('./../');
|
---|
4 |
|
---|
5 | var url = 'http://ibl.gamechaser.net/f/tagqfxtteucbuldhezkz/bt_level1.gz';
|
---|
6 |
|
---|
7 | var resp = needle.get(url, { compressed: true, follow_max: 10 });
|
---|
8 | console.log('Downloading...');
|
---|
9 |
|
---|
10 | resp.on('readable', function() {
|
---|
11 |
|
---|
12 | while (data = this.read()) {
|
---|
13 | var lines = data.toString().split('\n');
|
---|
14 | console.log('Got ' + lines.length + ' items.');
|
---|
15 | // console.log(lines);
|
---|
16 | }
|
---|
17 |
|
---|
18 | })
|
---|
19 |
|
---|
20 | resp.on('done', function(data) {
|
---|
21 | console.log('Done');
|
---|
22 | })
|
---|
Note:
See
TracBrowser
for help on using the repository browser.