Skip to main content
Module

x/froebel/promisify.ts

A strictly typed utility library.
Go to Latest
import * as froebel from "https://deno.land/x/froebel@v0.21.0/promisify.ts";

Variables

Turns a function accepting a callback into a function returning a promise. You can specify in which parameter (if any) the callback expects to receive a result and in which it expects an error. Pass null to resultIndex or errorIndex if no result or errors are passed to the callback. By default the first argument passed to the callback is interpreted as result and none of the arguments as error (if the function accepting the callback throws or rejects, that will still result in the promisified function rejecting).