Renege
Simple Node.js library to turn a typical callback function into a native ES6 Promise.
Installation
npm install renege
Prerequisites
Node.js v0.12
or greater is required. If using version v0.12
of Node, be sure to run node with the --harmony
flag specified.
node --harmony /path/to/your/app
Usage
This module exposes two methods:
renege.create
This method accepts a range of arguments for a method that has a callback following the typical callback(err, resultX, resultY, etc)
method signature. To call use this function, supply the function
, arg1
, arg2
, etc. as arguments.
var readPackageJsonFile = renege; readPackageJsonFile;
renege.promisify
This method accepts a single argument that is a function with a callback. This method is useful when creating a promise where you want to have flexibility in terms of what arguments you supply when calling it.
var readFile = renege;
Example:
var co = fs = https = koa = renege = ; moduleexports = { 'use strict'; var app = readFile = renege server; ; return app;};
renege.series
This method accepts a list of functions, each returning a Promise, and executes each one in the order that they appear within the list.
var list = { console; return ; } { console; return Promise; } { console; return ; }; renege ;