# nodeify-ts

> Create functions that both return promises and accept node-style callbacks

Latest version **1.0.6** (published 2018-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install nodeify-ts
pnpm add nodeify-ts
yarn add nodeify-ts
bun add nodeify-ts
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2018-08-04 |
| First published | 2016-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matthias Ludwig |
| Maintainers | mattqs |
| Keywords | nodeify, ascallback, Promise |

## Links

- npm: https://www.npmjs.com/package/nodeify-ts
- Repository: https://github.com/Quobject/nodeify-ts
- Issues: https://github.com/Quobject/nodeify-ts/issues
- npm.io page: https://npm.io/package/nodeify-ts

## 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.6 (latest) — 2018-08-04
- 1.0.5 — 2018-08-03
- 1.0.4 — 2018-08-03
- 1.0.3 — 2018-08-03
- 1.0.2 — 2018-08-03
- 1.0.1 — 2016-06-03
- 1.0.0 — 2016-06-03
- 0.0.1 — 2016-06-03

## README

# nodeify-ts
Create functions that both return promises and accept node-style callbacks

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Gitter][gitter-image]][gitter-url]

## Installation

    npm install nodeify-ts
    
## Usage

### Javascript

```js
var nodeify = require('nodeify-ts');

var command = function (command, callback) {
    var promise = Promise.resolve().then(function () {
        return Promise.resolve('do some work and return result ' + command);
    }).then(function (data) {
        return data;
    });
    return nodeify(promise, callback);
};
```

### Typescript

```js
import nodeify from 'nodeify-ts';

const command = function (command: string, callback?: (err, data) => void): Promise<any> {

  const promise = Promise.resolve().then(function () {
    return Promise.resolve('do some work and return result ' + command);
  }).then(function (data) {
    return data;
  });

  return nodeify(promise, callback);
};
```


## License

MIT

[npm-image]: https://img.shields.io/npm/v/nodeify-ts.svg?style=flat
[npm-url]: https://npmjs.org/package/nodeify-ts
[downloads-image]: https://img.shields.io/npm/dm/nodeify-ts.svg?style=flat
[downloads-url]: https://npmjs.org/package/nodeify-ts
[travis-image]: https://api.travis-ci.org/Quobject/nodeify-ts.svg
[travis-url]: https://travis-ci.org/Quobject/nodeify-ts/
[gitter-image]: https://badges.gitter.im/Quobject/nodeify-ts.svg
[gitter-url]: https://gitter.im/Quobject/nodeify-ts?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge

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