# pouchdb-size

> Adds disk_size to info()'s output for your leveldown backed PouchDB's.

Latest version **4.2.0** (published 2019-09-25) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install pouchdb-size
pnpm add pouchdb-size
yarn add pouchdb-size
bun add pouchdb-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 | 4.2.0 |
| Published | 2019-09-25 |
| First published | 2014-12-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 979 |
| Author | Marten de Vries |
| Maintainers | commandoline, daleharvey, garrensmith, nolanlawson |
| Keywords | pouch, pouchdb, couch, couchdb, size, disk_size, info, filesize |

## Links

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

## Dependencies (4)

- [bluebird](https://npm.io/package/bluebird.md) ^3.4.7
- [promise-nodify](https://npm.io/package/promise-nodify.md) ^1.0.2
- [get-folder-size](https://npm.io/package/get-folder-size.md) ^2.0.0
- [pouchdb-wrappers](https://npm.io/package/pouchdb-wrappers.md) 4.2.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 4.2.0 (latest) — 2019-09-25
- 5.0.1-rc1.0 (beta) — 2025-08-27
- 4.1.0 — 2018-08-13
- 4.0.1 — 2018-06-05
- 4.0.0 — 2018-01-27
- 1.2.2 — 2015-08-18
- 1.2.1 — 2015-01-07
- 1.2.0 — 2014-12-10
- 1.1.0 — 2014-12-10
- 1.0.1 — 2014-12-07
- 1.0.0 — 2014-12-05

## README

pouchdb-size
============

Adds disk_size to info()'s output for your *down backed PouchDB's.

Tested with leveldown, sqldown, jsondown, locket and medeadown. When it
can't determine the database size, it falls back to the default
``info()`` output.

Example
-------

```javascript
//index.js
var PouchDB = require('pouchdb');
PouchDB.plugin(require('pouchdb-size'));

var db = new PouchDB('test');
db.installSizeWrapper();
db.info().then(function (resp) {
	//resp will contain disk_size
})
```

API
---

### db.installSizeWrapper()

wraps ``db.info()`` in such a way that it will include a ``disk_size``
property in its output for supported database backends.

### `db.getDiskSize([callback])

like PouchDB, this method both returns a Promise and accepts a
callback. Either returns an error or the disk size of the current db.

Source
------

PouchDB Server and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).

For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb-server/tree/master/packages/node_modules).

License
-------

The Apache 2 License. See [the LICENSE file](https://github.com/pouchdb/pouchdb-server/blob/master/LICENSE) for more information.

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