Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 521 Bytes

README.md

File metadata and controls

32 lines (21 loc) · 521 Bytes

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()