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

node-downloader-helper

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-downloader-helper

A simple http/s file downloader for node.js

  • 2.1.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
281K
decreased by-20.44%
Maintainers
1
Weekly downloads
 
Created

What is node-downloader-helper?

The node-downloader-helper package is a Node.js library designed to facilitate the downloading of files from the internet. It provides a simple and efficient way to handle file downloads, including support for pause, resume, and cancel operations, as well as event-driven progress tracking.

What are node-downloader-helper's main functionalities?

Basic File Download

This feature allows you to download a file from a given URL to a specified directory. The example demonstrates how to initiate a download and log a message when the download is completed.

const { DownloaderHelper } = require('node-downloader-helper');
const dl = new DownloaderHelper('http://www.example.com/file.zip', './downloads');
dl.on('end', () => console.log('Download Completed'));
dl.start();

Pause and Resume Download

This feature allows you to pause and resume a download. The example demonstrates how to start a download, pause it after 5 seconds, and resume it after 10 seconds.

const { DownloaderHelper } = require('node-downloader-helper');
const dl = new DownloaderHelper('http://www.example.com/file.zip', './downloads');
dl.on('end', () => console.log('Download Completed'));
dl.start();
setTimeout(() => dl.pause(), 5000); // Pause after 5 seconds
setTimeout(() => dl.resume(), 10000); // Resume after 10 seconds

Progress Tracking

This feature allows you to track the progress of a download. The example demonstrates how to log the download progress percentage to the console.

const { DownloaderHelper } = require('node-downloader-helper');
const dl = new DownloaderHelper('http://www.example.com/file.zip', './downloads');
dl.on('progress', (stats) => console.log(`Downloaded ${stats.progress}%`));
dl.start();

Error Handling

This feature allows you to handle errors that occur during the download process. The example demonstrates how to log an error message if the download fails.

const { DownloaderHelper } = require('node-downloader-helper');
const dl = new DownloaderHelper('http://www.example.com/file.zip', './downloads');
dl.on('error', (err) => console.error('Download Failed', err));
dl.start();

Other packages similar to node-downloader-helper

Keywords

FAQs

Package last updated on 21 Jul 2023

Did you know?

Socket

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.

Install

Related posts

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