https://github.com/magicdawn/promise.ify
promiseify / promisify / promise-ify / pify
https://github.com/magicdawn/promise.ify
Last synced: 8 months ago
JSON representation
promiseify / promisify / promise-ify / pify
- Host: GitHub
- URL: https://github.com/magicdawn/promise.ify
- Owner: magicdawn
- License: mit
- Created: 2016-03-08T14:51:46.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-11-01T10:58:19.000Z (over 5 years ago)
- Last Synced: 2025-09-08T04:51:48.159Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# promise.ify
> promiseify / promisify / promise-ify / pify
[](https://travis-ci.org/magicdawn/promise.ify)
[](https://coveralls.io/github/magicdawn/promise.ify?branch=master)
[](https://www.npmjs.com/package/promise.ify)
[](https://www.npmjs.com/package/promise.ify)
[](http://magicdawn.mit-license.org)
## Note
this is target ES5 environment.
## Install
```
$ npm i promise.ify --save
```
## API
### promiseify
- promiseify(m, ctx)
- m: the input
- ctx: the context
- promiseify.all(o)
- o: the input object
```js
var promiseify = require('promise.ify')
var readFile = promiseify(fs.readFile, fs)
var Connection = require('mysql/lib/Connection')
promiseify.all(Connection.prototype)
```
### promiseify.noerr
take care of the `callback(result)` case
- promiseify.noerr(m, ctx)
- m: the input method
- ctx: the context
- promiseify.noerr.all(o)
- o: the input object
## Why
for split things out of bluebird
## Changelog
[CHANGELOG.md](CHANGELOG.md)
## See Also
- [promise.timeout](https://github.com/magicdawn/promise.timeout)
- [promise.retry](https://github.com/magicdawn/promise.retry)
- [promise.map](https://github.com/magicdawn/promise.map)
- [promise.ify](https://github.com/magicdawn/promise.ify)
- [promise.cb](https://github.com/magicdawn/promise.cb)
- [promise.obj](https://github.com/magicdawn/promise.obj)
- [promise.sleep](https://github.com/magicdawn/promise.sleep)
## License
the MIT License http://magicdawn.mit-license.org