# download-file

> Generic file download utility

Latest version **0.1.5** (published 2014-11-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install download-file
pnpm add download-file
yarn add download-file
bun add download-file
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2014-11-12 |
| First published | 2014-11-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Montana Flynn |
| Maintainers | montanaflynn |
| Keywords | download, file, url, get, http, https |

## Links

- npm: https://www.npmjs.com/package/download-file
- npm.io page: https://npm.io/package/download-file

## Dependencies (1)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.5 (latest) — 2014-11-12
- 0.1.4 — 2014-11-12
- 0.1.3 — 2014-11-12

## README

# download-file

## Install

```shell
npm install download-file --save
```

## Usage

```js
var download = require('download-file')

var url = "http://i.imgur.com/G9bDaPH.jpg"

var options = {
	directory: "./images/cats/",
	filename: "cat.gif"
}

download(url, options, function(err){
	if (err) throw err
	console.log("meow")
}) 
```

## API

### download(url, [options], callback(err))

- __url__ string of the file URL to download 

- __options__ object with options

  - __directory__ string with path to directory where to save files (default: current working directory)
  - __filename__ string for the name of the file to be saved as (default: filename in the url)
  - __timeout__ integer of how long in ms to wait while downloading (default: 20000)

- __callback__ function to run after

---
_Source: https://npm.io/package/download-file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
