# remote-file-size

> Get the size of a remote file

Latest version **3.0.5** (published 2018-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install remote-file-size
pnpm add remote-file-size
yarn add remote-file-size
bun add remote-file-size
```

Provides the command `remote-file-size`.

## 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 | 3.0.5 |
| Published | 2018-08-28 |
| First published | 2015-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Evan Lucas |
| Maintainers | eh, evanlucas |

## Links

- npm: https://www.npmjs.com/package/remote-file-size
- Repository: https://github.com/evanlucas/remote-file-size
- Issues: https://github.com/evanlucas/remote-file-size/issues
- npm.io page: https://npm.io/package/remote-file-size

## Dependencies (4)

- [help](https://npm.io/package/help.md) ~3.0.2
- [noptd](https://npm.io/package/noptd.md) ~2.0.0
- [request](https://npm.io/package/request.md) ~2.87.0
- [pretty-bytes](https://npm.io/package/pretty-bytes.md) ~5.1.0

## Recent versions

- 3.0.5 (latest) — 2018-08-28
- 3.0.4 — 2018-01-16
- 3.0.3 — 2015-11-03
- 3.0.2 — 2015-11-02
- 3.0.1 — 2015-11-02
- 3.0.0 — 2015-11-02
- 2.0.1 — 2015-06-04
- 2.0.0 — 2015-06-04
- 1.2.0 — 2015-06-03
- 1.1.0 — 2015-06-02
- 1.0.2 — 2015-06-02
- 1.0.1 — 2015-06-02
- 1.0.0 — 2015-06-02

## README

# remote-file-size

[![Build Status](https://travis-ci.org/evanlucas/remote-file-size.svg)](https://travis-ci.org/evanlucas/remote-file-size)
[![Coverage Status](https://coveralls.io/repos/evanlucas/remote-file-size/badge.svg?branch=master&service=github)](https://coveralls.io/github/evanlucas/remote-file-size?branch=master)

Get the size of a remote file

*Note: remote-file-size is only supported on iojs and node v4+. To use with
an older version of node, please use `remote-file-size@2`.*

## Install

```bash
$ npm install --save remote-file-size
# or for the cli tool
$ npm install -g remote-file-size
```

## Usage

```bash
$ remote-file-size http://registry.npmjs.org/argsplit/-/argsplit-1.0.2.tgz
// => 1.55 kB
```

```js
var remote = require('remote-file-size')
var url = 'http://registry.npmjs.org/argsplit/-/argsplit-1.0.2.tgz'
remote(url, function(err, o) {
  console.log(o)
  // => 1548
})
```

## CLI Usage

```
$ remote-file-size --help

remote-file-size - get the size of a remote file

  usage: remote-file-size [options] <url>

  options:
    -h, --help                  show help and usage
    -v, --version               show version
    -r, --raw                   show raw result (no pretty formatting)
    -f, --follow-redirect       follow redirects (true by default)
    -m, --max-redirects <num>   set max number of redirects (defaults to 2)

  example:
    remote-file-size http://registry.npmjs.org/argsplit/-/argsplit-1.0.2.tgz
    // => 1.55 kB

    remote-file-size --raw http://registry.npmjs.org/argsplit/-/argsplit-1.0.2.tgz
    // => 1548
```

`remote-file-size` uses `request` under the hood, so you could
also pass an options object instead of the url string.

## Author

Evan Lucas

## License

MIT (See `LICENSE` for more info)

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