• Stars
    star
    20
  • Rank 1,121,974 (Top 23 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Await/async wrapper with error handling, retry and error override

πŸ‘€

Async/await wrapper with error handling, retry and error override πŸ’œ ❀️ πŸ’›
Heavily inspired by await-to-js
Example

πŸš€ Install

npm i @zmotivat0r/o0

πŸ‘“ 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('(>_<)'),
  });
}

πŸ”¨ Test

npm test