down-bin

1.0.2 • Public • Published

down-bin

A simple Node.js module to download binary files from a provided URL.

Installation:

Install the package via npm:

npm install down-bin

Usage:

    const downloadFile = require('down-bin');

    // Usage example
    const fileUrl = 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf';
    downloadFile(fileUrl);
  • The downloadFile function allows you to download binary files from a given URL. It retrieves the file based on the provided URL and saves it with its original filename in the current directory.

Function Parameters

  • url: The URL of the file to be downloaded.

Behavior

  • Downloads the file from the provided URL.
  • Determines if the file is binary based on the content-type header.
  • Excludes HTML content from downloading.

Package Sidebar

Install

npm i down-bin

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

2.26 kB

Total Files

3

Last publish

Collaborators

  • suraj_chandra