# compare-size

> Compare size between two files

Latest version **3.0.0** (published 2016-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install compare-size
pnpm add compare-size
yarn add compare-size
bun add compare-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.0 |
| Published | 2016-09-06 |
| First published | 2014-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Kevin Mårtensson |
| Maintainers | kevva |
| Keywords | compare, file, fs, size |

## Links

- npm: https://www.npmjs.com/package/compare-size
- Repository: https://github.com/kevva/compare-size
- Homepage: https://github.com/kevva/compare-size#readme
- Issues: https://github.com/kevva/compare-size/issues
- npm.io page: https://npm.io/package/compare-size

## Dependencies (1)

- [pify](https://npm.io/package/pify.md) ^2.3.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

- 3.0.0 (latest) — 2016-09-06
- 2.0.0 — 2016-04-11
- 1.0.2 — 2014-10-28
- 1.0.1 — 2014-10-12
- 1.0.0 — 2014-10-11

## README

# compare-size [![Build Status](http://img.shields.io/travis/kevva/compare-size.svg?style=flat)](https://travis-ci.org/kevva/compare-size)

> Compare size between two files


## Install

```
$ npm install --save compare-size
```


## Usage

```js
const compareSize = require('compare-size');

compareSize('foo.zip', 'bar.zip').then(data => {
	console.log(data);
	//=> {foo.zip: 439, bar.zip: 325, difference: 114}
});

compareSize.sync('foo.zip', 'bar.zip');
//=> {foo.zip: 439, bar.zip: 325, difference: 114}
```


## API

### compareSize(a, b)

Compares size between two files. Returns a promise for an object with the stats difference.

#### a

Type: `string`

Path to the first file.

#### b

Type: `string`

Path to the second file.


## Related

* [compare-size-cli](https://github.com/kevva/compare-size-cli) - CLI for this module


## License

MIT © [Kevin Mårtensson](https://github.com/kevva)

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