promisify-function

Turn a callback-style function into a function that returns a promise

ISC 10 个版本
安装
npm install promisify-function
yarn add promisify-function
pnpm add promisify-function
bun add promisify-function
README

promisify-function

npm Build Status Coverage Status Dependency Status devDependency Status js-standard-style Commitizen friendly semantic-release

Turn a callback style function into a function that returns a promise.

Installation

The recommended way to install promisify-function is as a dependency of a project:

npm install --save promisify-function

Usage

Pass a callback style function and get a function the returns a Promise as result:

const fs = require('fs')
const promisify = require('promisify-function')
const mkdir = promisify(fs.mkdir)

Contributing

Any contribution is more than welcome. In particular, if:

  • there's something that doesn't work as expected or you have an idea for a nice to have feature, then please submit an issue here
  • you know how to fix a problem or improve the code, then please submit a pull request here
版本列表
1.3.2 2016-02-02
1.3.1 2016-02-02
1.3.0 2016-02-02
1.2.1 2016-01-22
1.2.0 2016-01-20
1.1.3 2016-01-20
1.1.2 2016-01-19
1.1.1 2016-01-18
1.1.0 2016-01-18
1.0.0 2016-01-18