JSPM

@zmotivat0r/o0

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 30503
  • Score
    100M100P100Q159801F
  • License MIT

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

Package Exports

  • @zmotivat0r/o0

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@zmotivat0r/o0) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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