# downloadable

> check if url downloadable before download

Latest version **1.0.9** (published 2019-01-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install downloadable
pnpm add downloadable
yarn add downloadable
bun add downloadable
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2019-01-28 |
| First published | 2016-11-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Peter Chang |
| Maintainers | wahengchang |
| Keywords | check, url, download, downloadable, checker |

## Links

- npm: https://www.npmjs.com/package/downloadable
- Repository: https://github.com/wahengchang/downloadable
- Homepage: https://github.com/wahengchang/downloadable#readme
- Issues: https://github.com/wahengchang/downloadable/issues
- npm.io page: https://npm.io/package/downloadable

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.9 (latest) — 2019-01-28
- 1.0.7 (release) — 2019-01-28
- 1.0.8 — 2019-01-28
- 1.0.6 — 2019-01-28
- 1.0.5 — 2019-01-21
- 1.0.2 — 2018-11-02
- 1.0.3 — 2018-11-02
- 1.0.1 — 2018-11-02
- 1.0.0 — 2016-11-10

## README

# downloadable

Check if url downloadable before download. 
 - resolve a promise with the HTTP headers when given URL is downloadable (should have 'content-type' and 'content-length')
 - reject a promise with error message when given URL is not downloadable

[![NPM](https://nodei.co/npm/downloadable.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/downloadable)


## Install

```
$ npm install --save downloadable
```

## Test

```
$ npm test
```


## Usage

```js
    const downloadable = require("downloadable");
    const imageUrl = 'https://cdn1.iconfinder.com/data/icons/logotypes/32/square-facebook-512.png'

    downloadable(imageUrl).then(function(headers){
      console.log(headers['content-type'])
      console.log(headers['content-length'])
      // link is downloadable, do something ....
    },function(err){
      // link is not downloadable, do something else ....
    });

```


## License


[MIT](http://vjpr.mit-license.org)

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