Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
downloadAPI
Advanced tools
downloadAPI to download file from URL to local by http/https request in nodejs, and resolve a promise when it is done.
downloadAPI to download file from URL to local by http/https request in nodejs, and resolve a promise when it is done.
$ npm install --save downloadAPI
Chain version
var downloadAPI = require('downloadAPI');
var url = "http://abc"
var path = _dirname + "/upload"
downloadAPI(url).setPath(path).start().then(function(result){
//...... file is downloaded to local
},function(error){
//...... do somthing
})
Function version
var downloadAPI = require('downloadAPI');
var url = "http://abc"
var path = _dirname + "/upload"
var API = downloadAPI(url)
API.setPath(path)
API.start().then(function(result){
//...... file is downloaded to local
},function(error){
//...... do somthing
})
Giving download url as parameter, and start check up if it is work and downloadable.
var downloadAPI = require('downloadAPI');
downloadAPI("www.abc.jpg")
Giving destination directory as parameter, which needed to be created before storing the download file.
var downloadAPI = require('downloadAPI');
downloadAPI("www.abc.jpg")
downloadAPI.setPath(path)
or
downloadAPI("www.abc.jpg").setPath("/upload/directary")
It is a function which return a promise, to trigger download, from the given URL to the given Directary and process the url validate checkup before download.
var downloadAPI = require('downloadAPI');
downloadAPI("www.abc.jpg")
downloadAPI.setPath(path)
downloadAPI.start().then(function(result){
//...... file is downloaded to local
},function(error){
//...... do somthing
})
or
downloadAPI("www.abc.jpg").setPath("/upload/directary").then(function(result){
//...... file is downloaded to local
},function(error){
//...... do somthing
})
It is a function which return a promise, to check if the url parameter downloadable.
var API = downloadAPI(url)
API.isDownloadable(url).then(function(isDownloadable){
//...... file is downloaded to local
},function(error){
//...... do somthing
})
MIT © Kevin Mårtensson
FAQs
downloadAPI to download file from URL to local by http/https request in nodejs, and resolve a promise when it is done.
We found that downloadAPI demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.