This package has been deprecated

Author message:

ABANDONED: use pify instead

@jokeyrhyme/promisify

1.0.0 • Public • Published

promisify.js

wrap a Node.js-style asynchronous function so that it returns a Promise

npm module Build Status

Usage

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

Package Sidebar

Install

npm i @jokeyrhyme/promisify

Weekly Downloads

1

Version

1.0.0

License

BSD-2-Clause

Last publish

Collaborators

  • jokeyrhyme