mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-19 18:14:15 +00:00
api
This commit is contained in:
9
node_modules/needle/examples/stream-to-file.js
generated
vendored
Normal file
9
node_modules/needle/examples/stream-to-file.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
var fs = require('fs'),
|
||||
needle = require('./..'),
|
||||
path = require('path');
|
||||
|
||||
var url = process.argv[2] || 'http://www.google.com/images/errors/robot.png';
|
||||
var file = path.basename(url);
|
||||
|
||||
console.log('Downloading ' + file);
|
||||
needle.get(url).pipe(fs.createWriteStream(file));
|
Reference in New Issue
Block a user