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

@gasket/fetch

Package Overview
Dependencies
Maintainers
0
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gasket/fetch

Gasket Fetch API

  • 7.0.0-next.66
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by66.67%
Maintainers
0
Weekly downloads
 
Created
Source

@gasket/fetch

Gasket will utilize the Fetch API as our standard request library. This package serves as a proxy for fetch implementations with server-side support.

Installation

npm i @gasket/fetch

Usage

Example with promises
import fetch from '@gasket/fetch';

fetch('url/to/resource')
  .then(res => {
    if (res.ok) {
      // handle success
    } else {
      // handle error
    }
  });
Example with async/await
import fetch from '@gasket/fetch';

const getSomething = async () => {
  const res = await fetch('url/to/resource');
  if (res.ok) {
    // handle success
  } else {
    // handle error
  }
};

Reference

  • https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
  • https://www.npmjs.com/package/node-fetch

License

MIT

Keywords

FAQs

Package last updated on 12 Sep 2024

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