📦
unwrapit
  • 👋Welcome to unwrapit
  • Intro
    • 💡Why use it?
    • ✨Getting Started
  • APIs
    • 🔨wrap
    • 🔨unwrap
    • 🔨unwrapOr
    • 🔨unwrapOrElse
    • 🔨expect
    • 🔨mapErr
    • 🔨defineWrapConfig
    • 🔨ok
    • 🔨err
  • Type
    • 🔧Result
    • 🔧WrapConfig
    • 🔧WrapOption
    • 🔧Panic
  • Recipe
    • 🎨Export Wrapped Functions
    • 🎨Return Result Without `wrap` it
Powered by GitBook
On this page
  • Installation
  • Usage
  1. Intro

Getting Started

Installation

pnpm i unwrapit
yarn add unwrapit
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()
PreviousWhy use it?Nextwrap

Last updated 1 year ago

✨