promisifier

A simple callback that turns every Async function into promise.

npm install promisifier
10 downloads in the last week
26 downloads in the last month

Promisifier

Turns any Async JS function into a Promise.

Installation

$ npm install promisifier

Usage

var promisifier = require("promisifier");

promisifier.asyncMethodToPromise(method,[arg1[, arg2[, ...]]])

Promisify an Async function with arguments.

var promisifier = require("promisifier"),
    request = require("request");

var promise = promisifier.asyncMethodToPromise(request.get, "http://google.com", options);

promise.then(console.log);

asyncMethodToPromiseWithArrayAsArgs(method, args)

Pass args as array.

var promisifier = require("promisifier"),
    request = require("request");

var args = [
    "http://google.com",
    {}
];

var promise = promisifier.asyncMethodToPromise(request.get, args);

promise.then(console.log);
npm loves you