Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fetchmap

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetchmap

Non-throwing fetch wrapper

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

fetchmap

npm build publish codecov Type Coverage Libraries.io dependency status for latest release Bundlephobia npm

Non-throwing fetch wrapper

Getting started

npm i fetchmap

Description

This is a simple wrapper for standard fetch function that takes extended RequestInit and optional third-party fetch funcition, catches all possible exceptions and returns a 'success or failure' wrapped value. By default this value is just Response, but mapSuccess and mapFailure options can be used to transform the received Response. If response.ok is true response will be transformed by mapSuccess, otherwise - by mapFailure. Possible errors are divided into clientError, mapError and serverError.

Usage

See test or playground

Misc

ts-railway - compatible result library

Keywords

FAQs

Package last updated on 02 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc