2.0.0 • Published 3 years ago

await-to-fetch v2.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

await-to-fetch Build Status

Easy error handling for async/await without try/catch blocks that works with fetch.

Install

$ npm install await-to-fetch

Usage

import to from 'await-to-fetch'

async function example() {
  const [err, res] = await to(fetch('https://httpstat.us/200'))

  if (err) {
    throw err
  }

  return res
}

Credits

2.0.0

3 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago