@zmotivat0r/o0
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published
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

Package Sidebar

Install

npm i @zmotivat0r/o0

Weekly Downloads

42,146

Version

1.0.2

License

MIT

Unpacked Size

4.53 kB

Total Files

6

Last publish

Collaborators

  • zmotivat0r