unwrapit
TypeScript icon, indicating that this package has built-in type declarations

2.5.0 • Public • Published

unwrapit

npm package

unwrapit provides a way to handle errors in JS/TS gracefully and intuitively.

Documentation

https://musicq.gitbook.io/unwrapit/

Getting start

npm i unwrapit

Usage

import {wrap} from 'unwrapit'

async function main() {
  const get = wrap(fetch)
  const res = await get('https://google.com')

  console.log(res.unwrap().status)
}

main()

Package Sidebar

Install

npm i unwrapit

Weekly Downloads

1

Version

2.5.0

License

MIT

Unpacked Size

24.2 kB

Total Files

7

Last publish

Collaborators

  • musicq