# callback-wrap

> Wrapper for callback returning functions to transform them in promise returning functions.

Latest version **1.0.0** (published 2014-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install callback-wrap
pnpm add callback-wrap
yarn add callback-wrap
bun add callback-wrap
```

## 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 | 2014-12-07 |
| First published | 2014-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Adrian Punga |
| Maintainers | sqreept |
| Keywords | callback, wrap, wrapper, promise |

## Links

- npm: https://www.npmjs.com/package/callback-wrap
- Repository: https://github.com/sqreept/callback-wrap
- Issues: https://github.com/sqreept/callback-wrap/issues
- npm.io page: https://npm.io/package/callback-wrap

## 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) — 2014-12-07

## README

# callback-wrap [![Build Status](https://travis-ci.org/sqreept/callback-wrap.svg)](https://travis-ci.org/sqreept/callback-wrap)

 Wrapper for callback returning functions to transform them in promise returning functions.
 
## Installation

```js
$ npm install callback-wrap
```

## Example

```js
var wrap = require('callback-wrap');

function cbkfn(a, b, c, cbk) {
	if (a < b) {
		return cbk(new Error('Error'));
	}
	return cbk(null, c);
}

var prmfn = wrap(cbkfn);

prmfn(4, 2, 3)
	.then(
	function (result) {
		console.log(result);
	},
	function (err) {
		console.log(err);
	}
);
```

## API

### wrap(callbackFunction)

Wraps the callback function in a promise function that is returned.

## License

  MIT

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