fetch-download

1.1.1 • Public • Published

fetch-download

A package to download files with javascript using the fetch interface

Usage

fetchDownload(url, options?)
Returns a promise, failing if the response has a error status or connection error. The second parameter is an options object that will be passed to the native fetch

fetchDownload=require('fetch-download');

fetchDownload(url).catch((err)=>{
    console.error(err); // {status: 404}
});

/fetch-download/

    Package Sidebar

    Install

    npm i fetch-download

    Weekly Downloads

    2

    Version

    1.1.1

    License

    GPL-3.0

    Unpacked Size

    37.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • shuttlecloud