Skip to content
Tiny, dependency free promisify library.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.eslintrc.json
.gitignore
.huskyrc.json
.lintstagedrc
.npmignore
.size-limit.js
.travis.yml
LICENSE
README.md
package.json
promisify.d.ts
promisify.js
test.js
util.js
yarn.lock

README.md

@octetstream/promisify

Tiny, dependency free promisify library.

devDependencies Status Build Status Code Coverage

API

promisify(target[, ctx]) -> {Function}

Promisify Node.js callback-style function with native Promise

  • {Function} target - function, that will be wrap with a Promise
  • {any} [ctx = null] - "this" context for a target function

promisify.all(targets[, ctx]) -> {object}

Promisify all functions from given object

  • {object} targets – object of target functinos
  • {any} [ctx = null] - "this" context for all wrapped functions

promisify.some(targets, list[, ctx]) -> {object}

Promisify some functions from given object, that was specified in list

  • {object} targets – object of target functinos
  • {string[]} list – an array of target functions names
  • {any} [ctx = null] - "this" context for all wrapped functions

promisify.except(targets, list[, ctx]) -> {object}

Promisify all functions from given object, except the ones from list

  • {object} targets – object of target functinos
  • {string[]} list – an array of target functions names
  • {any} [ctx = null] - "this" context for all wrapped functions
You can’t perform that action at this time.