Skip to content
This repository was archived by the owner on Apr 11, 2023. It is now read-only.

mike182uk/tmpdl

Repository files navigation

⚠️ This project is no longer maintained

tmpdl

Version Build Status Coveralls npm License

Download a remote file to a temporary location.

Installation

npm install --save tmpdl

Usage

const tmpdl = require('tmpdl')

try {
  const filepath = await tmpdl('http://www.example.com/some-awesome-image.jpg')

  // remote file successfully downloaded and stored
} catch (err) {
  // something went wrong
}

tmpdl will return a promise which will resolve to the path of the saved file. Any errors that occur during the download of the file, or the creation of the temporary directory that the remote file will be stored in, will cause the promise to reject.

About

Download a remote file to a temporary location

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5