Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
360 bytes
|
Line | |
---|
1 | var fs = require('fs'),
|
---|
2 | needle = require('./..'),
|
---|
3 | path = require('path');
|
---|
4 |
|
---|
5 | var url = process.argv[2] || 'http://www.google.com/images/errors/robot.png';
|
---|
6 | var file = path.basename(url);
|
---|
7 |
|
---|
8 | console.log('Downloading ' + file + '...');
|
---|
9 | needle
|
---|
10 | .get(url)
|
---|
11 | .pipe(fs.createWriteStream(file))
|
---|
12 | .on('done', function() {
|
---|
13 | console.log('Done!')
|
---|
14 | })
|
---|
Note:
See
TracBrowser
for help on using the repository browser.