# @ddatabase/promisifier

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

Latest version **1.0.0** (published 2021-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ddatabase/promisifier
pnpm add @ddatabase/promisifier
yarn add @ddatabase/promisifier
bun add @ddatabase/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.0.0 |
| Published | 2021-03-12 |
| First published | 2021-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | PeepsLabs |
| Maintainers | dwebprotocol |
| Keywords | ddatabase, promises |

## Links

- npm: https://www.npmjs.com/package/@ddatabase/promisifier
- Repository: https://github.com/dwebprotocol/ddatabase-promisifier
- Homepage: https://dwebx.org
- Issues: https://github.com/dwebprotocol/ddatabase-promisifier/issues
- npm.io page: https://npm.io/package/@ddatabase/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

- [@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
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-03-12

## README

ddatabase-promisifier


A wrapper that provides conversion to/from callback/promise interfaces in DDatabase and RemoteDDatabase.

## Installation
```
npm i @ddatabase/promisifier
```

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

const base = ddatabase(ram)

// A promisified DDatabase interface
const wrapper = toPromises(base)
```

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

#### `const { toCallbacks, toPromises, unwrap } = require('@ddatabase/promisifier')`

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

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

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

## License
MIT

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