promisify-api
Changes interface of asynchronous functions to Promises. Functions should be designed using error-first callback pattern.
Installation
$ npm install promisify-api
Usage
promisify(fn, ctx, _)
Creates a wrapper function, which returns Promises.
const fs = ;const resolve = resolve;const promisify = ; // the second argument (which is context) is optionalconst readFile = ; ;
Arguments:
fn (function)
: The original function.ctx (*)
: Predefines execution context of the original function...._ (*)
: Possibility to provide additional arguments, that will be prepended to the function.
License
The MIT License