Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.61 KB

README.md

File metadata and controls

50 lines (36 loc) · 1.61 KB

Safe Await

Safely use async/await without all the try catch blocks

Usage

const safeAwait = require('safe-await')

async function fooBar() {
  const [error, data] = await safeAwait(promiseOne())

  if (error) {
    // handle error, retry, ignore, whatever
  }

  console.log(data)
}

See usage and tests for more examples.

Research

Other libraries

Other handy error utils