Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
easy-downloader
Advanced tools
Readme
Download file from remote URL easily.
$ npm install easy-downloader
const easyDownload = require("easy-downloader");
(async () => {
try {
await easyDownload("https://httpbin.org/image/jpeg", "foo/bar/baz.jpg");
} catch (error) {
console.error(error.message);
}
})();
The foo/bar
directory will be created automatically if it does not exist.
easyDownload(url, destination, [options]);
url
(String
): The file URL to download.destination
(String
): The path to save the downloaded file.options
(optional Object
): The HTTP request configuration
method
(String
): The HTTP method to use, default to GET
.headers
(Object
): The request headers to send.auth.username
(String
): The username for HTTP basic auth.auth.password
(String
): The password for HTTP basic auth.body
(Object|FormData
): The request body to send. It can be a plain JavaScript object or an instance of FormData
.json
(Boolean
): Set to true
if you want to send the request body with application/json
content type. Default to false
, which means that the request body will be sent as application/x-www-form-urlencoded
. Note that you can still override the content type using the headers
option.FAQs
Download file from remote URL easily.
The npm package easy-downloader receives a total of 11 weekly downloads. As such, easy-downloader popularity was classified as not popular.
We found that easy-downloader 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.