Created
April 22, 2021 00:11
-
-
Save bcomnes/416bd80f7fe9a02e9232988ab4874a01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://ballpit.github.io/website/pics.zip | |
const fs = require('fs') | |
const get = require('simple-get') | |
const pump = require('pump') | |
const path = require('path') | |
get('https://ballpit.github.io/website/pics.zip', (err, res) => { | |
if (err) throw err | |
const outStream = fs.createWriteStream(path.join(__dirname, 'pics.zip')) | |
pump(res, outStream, (err) => { | |
if (err) throw err | |
console.log('done') | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "download-example", | |
"version": "0.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io/)", | |
"license": "MIT", | |
"dependencies": { | |
"pump": "^3.0.0", | |
"simple-get": "^4.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment