Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jokeyrhyme/promisify.js
ABANDONED: wrap a Node.js-style asynchronous function so that it returns a Promise
https://github.com/jokeyrhyme/promisify.js
Last synced: 21 days ago
JSON representation
ABANDONED: wrap a Node.js-style asynchronous function so that it returns a Promise
- Host: GitHub
- URL: https://github.com/jokeyrhyme/promisify.js
- Owner: jokeyrhyme
- License: bsd-2-clause
- Created: 2015-12-07T09:04:09.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-16T04:55:01.000Z (almost 8 years ago)
- Last Synced: 2024-10-14T21:23:52.664Z (25 days ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# promisify.js
wrap a Node.js-style asynchronous function so that it returns a Promise
[![npm module](https://img.shields.io/npm/v/@jokeyrhyme/promisify.svg)](https://www.npmjs.com/package/@jokeyrhyme/promisify)
[![Build Status](https://travis-ci.org/jokeyrhyme/promisify.js.png)](https://travis-ci.org/jokeyrhyme/promisify.js)## ABANDONED
Use [pify](https://github.com/sindresorhus/pify) instead
## Usage
```js
const promisify = require('@jokeyrhyme/promisify');const fs = require('fs');
const readdir = promisify(fs.readdir);
fs.readdir(process.cwd())
.then((result) => { /* ... */ })
.catch((err) => { /* ... */ });
```## API
### `promisify (context?: Object, Function) => Promiser`
```
interface Promiser {
(...args: Any[]) => Promise
}
```## Related
- callbackify: https://github.com/jokeyrhyme/callbackify.js