Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@zmotivat0r/o0

zMotivat0r129.2kMIT1.0.2TypeScript support: included

Async/await wrapper with error handling, retry and error override

typescript, node, error, handler, promise, es2018, async, asyncawait, try, catch, trycatch, retry, go, golang, await-to-js, await-to-ts

readme

Async/await wrapper with error handling, retry and error override
Heavily inspired by await-to-js
Example

:rocket: Install

npm i @zmotivat0r/o0

:eyeglasses: Usage

import { oO } from '@zmotivat0r/o0';

async function do() {
  const [err, user] = await oO(findUser(1));

  const [, projects] = await oO(findProjects(1), {
    retry: 5,
  });

  const [customError] = await oO(doStuff(), {
    err: new SomeCustomError('(>_<)'),
  });
}

:hammer: Test

npm test