Nostradamus Prophecy Machine
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    promisifierpublic

    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);

    Keywords

    none

    install

    npm i promisifier

    Downloadsweekly downloads

    39

    version

    0.1.4

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar