@appgeist/get-file-from-url

Utility function to download a file from a specified URL and return a Promise when done


Keywords
utilities, file, download, promise, nodejs, server-side
License
ISC
Install
npm install @appgeist/get-file-from-url@1.1.3

Documentation

@appgeist/get-file-from-url

NPM version License

Utility function to download a file from a specified URL. Returns a Promise that fulfills with the local file name upon download completion.

Usage

const getFileFromUrl = require("@appgeist/get-file-from-url");

const localFileName = await getFileFromUrl({
  url: "https://example.com/catz-picture.jpg",
  file: "/path/to/local-catz-picture.jpg"
});

console.log(localFileName); // -> "/path/to/local-catz-picture.jpg"

License

The ISC License.