ambi

  • Version 8.24.0
  • Published
  • 43.5 kB
  • 1 dependency
  • MIT license

Install

npm i ambi
yarn add ambi
pnpm add ambi

Overview

Ambi lets you execute any function ambidextrously; providing you the ability to execute any function (be it synchronous, asynchronous, returns, callbacks, promises) as if it returned a promise.

Index

Functions

Functions

function ambi

ambi: <Result>(method: Function, ...args: any) => Promise<Result>;
  • Ambidextrously execute the method with the passed arguments. If method.length > args.length, then ambi provides the method with a completion callback as the last expected argument.

    Parameter method

    A method, that can either resolve synchronously, via a promise, or via a callback.

    Parameter args

    The arguments to provide the function.

    Returns

    The determined result.

Package Files (1)

Dependencies (1)

Dev Dependencies (17)

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ambi.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ambi)
  • HTML
    <a href="https://www.jsdocs.io/package/ambi"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>