# hypercore-promisifier

> A Hypercore wrapper that lets you switch between callback and Promise APIs

Latest version **1.1.0** (published 2021-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install hypercore-promisifier
pnpm add hypercore-promisifier
yarn add hypercore-promisifier
bun add hypercore-promisifier
```

## 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.1.0 |
| Published | 2021-01-14 |
| First published | 2020-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Andrew Osheroff |
| Maintainers | andrewosh |
| Keywords | hypercore, promises |

## Links

- npm: https://www.npmjs.com/package/hypercore-promisifier
- Repository: https://github.com/andrewosh/hypercore-promisifier
- Homepage: https://github.com/andrewosh/hypercore-promisifier#readme
- Issues: https://github.com/andrewosh/hypercore-promisifier/issues
- npm.io page: https://npm.io/package/hypercore-promisifier

## Dependencies (2)

- [call-me-maybe](https://npm.io/package/call-me-maybe.md) ^1.0.1
- [inspect-custom-symbol](https://npm.io/package/inspect-custom-symbol.md) ^1.1.1

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-01-14
- 1.0.3 — 2020-12-07
- 1.0.2 — 2020-12-07
- 1.0.1 — 2020-12-07
- 1.0.0 — 2020-12-07

## README

# hypercore-promisifier
![Test on Node.js](https://github.com/andrewosh/hypercore-promisifier/workflows/Test%20on%20Node.js/badge.svg)

A wrapper that provides conversion to/from callback/promise interfaces in Hypercore and RemoteHypercore.

## Installation
```
npm i hypercore-promisifier
```

## Usage
```js
const hypercore = require('hypercore')
const ram = require('random-access-memory')
const { toPromises } = require('hypercore-promisifier')

const core = hypercore(ram)

// A promisified Hypercore interface
const wrapper = toPromises(core)
```

## API
The API supports two methods, each one returning a compatibilty wrapper around Hypercore.

#### `const { toCallbacks, toPromises, unwrap } = require('hypercore-promisifier')`

`toCallbacks(core)` takes a Hypercore-like object with a Promises API, and returns a wrapper with a
callbacks interfaced.

`toPromises(core)` takes a Hypercore-like object with a callbacks API, and returns a wrapper with a
Promises interface.

`unwrap(core)` takes either a wrapper object, or a normal Hypercore, and returns a normal (callbacks API) Hypercore.

## License
MIT

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