Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

download-to-file

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

download-to-file - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

4

index.js

@@ -22,5 +22,7 @@ 'use strict'

var file = fs.createWriteStream(filepath)
pump(res, file, cb)
pump(res, file, function (err) {
cb(err, filepath)
})
})
}).on('error', cb)
}
{
"name": "download-to-file",
"version": "2.0.0",
"version": "2.1.0",
"description": "Download a file to disk programmatically",

@@ -8,6 +8,6 @@ "main": "index.js",

"mkdirp": "^0.5.1",
"pump": "^1.0.2"
"pump": "^2.0.0"
},
"devDependencies": {
"standard": "^8.6.0",
"standard": "^10.0.3",
"tape": "^4.6.3"

@@ -36,5 +36,5 @@ },

"coordinates": [
53.561964585443945,
9.98561523076171
48.866051,
2.3565218
]
}

@@ -20,5 +20,5 @@ # download-to-file

console.log('Downloading to /tmp/example.html')
download('http://example.com/', '/tmp/example.html', function (err) {
download('http://example.com/', '/tmp/example.html', function (err, filepath) {
if (err) throw err
console.log('Download finished')
console.log('Download finished:', filepath)
})

@@ -33,3 +33,4 @@ ```

specified by `filepath`. When done, the `callback` will be called with
an optional error object as the first argument.
an optional error object as the first argument and the `filepath` as the
second argument.

@@ -36,0 +37,0 @@ If the server does not return a 200 HTTP status code, the callback will

@@ -20,6 +20,7 @@ 'use strict'

var file = path.join(DIR, String(Date.now()))
download(url, file, function (err) {
download(url, file, function (err, filepath) {
t.error(err)
t.ok(fs.existsSync(file))
t.ok(fs.readFileSync(file), 'Hello World')
t.equal(file, filepath)
server.close()

@@ -26,0 +27,0 @@ t.end()

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc