Socket
Book a DemoInstallSign in
Socket

@gasket/fetch

Package Overview
Dependencies
Maintainers
8
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gasket/fetch

Gasket Fetch API

7.3.8
latest
Source
npmnpm
Version published
Weekly downloads
128
137.04%
Maintainers
8
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

fetch

FAQs

Package last updated on 07 Aug 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.