# callback-to-promise-operator

> An operator that converts asynchronous functions expecting a callback to functions returning a Promise.

Latest version **0.0.1** (published 2017-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install callback-to-promise-operator
pnpm add callback-to-promise-operator
yarn add callback-to-promise-operator
bun add callback-to-promise-operator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-02-04 |
| First published | 2017-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jeremy Judeaux |
| Maintainers | volune |
| Keywords | asynchronous, callback, promise, operator |

## Links

- npm: https://www.npmjs.com/package/callback-to-promise-operator
- Repository: https://github.com/volune/callback-to-promise-operator
- Homepage: https://github.com/volune/callback-to-promise-operator#readme
- Issues: https://github.com/volune/callback-to-promise-operator/issues
- npm.io page: https://npm.io/package/callback-to-promise-operator

## 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

- 0.0.1 (latest) — 2017-02-04

## README

# Callback-To-Promise Operator

[![npm version](https://badge.fury.io/js/callback-to-promise-operator.svg)](https://badge.fury.io/js/callback-to-promise-operator) [![Build Status](https://travis-ci.org/Volune/callback-to-promise-operator.svg?branch=master)](https://travis-ci.org/Volune/callback-to-promise-operator)

An operator that converts asynchronous functions expecting a callback to functions returning a Promise.

## Example

```javascript
// Use whatever variable name that you like for the operator
const $P = require('callback-to-promise-operator').default;

// With an asynchronous function expection a callback
const delayUpperCase = (value, callback) => {
  setTimeout(() => callback(null, value.toUpperCase()), 1000);
};

// Use it as if it was returning a Promise
delayUpperCase[$P]('string')
  .then((result) => {
    console.log(result);
  });
```

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