async-invoker

Create a runner of code asynchronous


Keywords
eval, async
License
MIT
Install
npm install async-invoker@1.1.1

Documentation

Async invoker

NPM version

Create a promise with result of the invoke your code.

Sync function - example

    AsyncInvoker = require "async-invoker"
    code = " function (a, b) { return a + b; } "
    
    new AsyncInvoker(code)
    .invoke (1, 2)
    .tap console.log  # 3

Async function - example

    AsyncInvoker = require "async-invoker"
    code = " function (callback) { callback(1 + 2); } "
    
    new AsyncInvoker(code)
    .invoke()
    .tap console.log  # 3