# @shopify/network

> Common values related to dealing with the network

Latest version **3.3.0** (published 2024-06-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @shopify/network
pnpm add @shopify/network
yarn add @shopify/network
bun add @shopify/network
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.3.0 |
| Published | 2024-06-10 |
| First published | 2018-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.12.0 |
| Dependencies | 0 |
| Unpacked size | 45.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shopify Inc. |
| Maintainers | jaimie.rockburn, blittle, shopify-admin, maryharte, crisfmb, pmoloney89, netlohan, st999999, justin-irl, megswim, wcandillon, nathanpjf, shopify-dep, goodforonefare, lemonmade, vsumner, wizardlyhel, antoine.grant, tsov, andyw8-shopify, henrytao, hannachen, vividviolet, bpscott |

## Links

- npm: https://www.npmjs.com/package/@shopify/network
- Repository: https://github.com/Shopify/quilt
- Homepage: https://github.com/Shopify/quilt/blob/main/packages/network/README.md
- Issues: https://github.com/Shopify/quilt/issues
- npm.io page: https://npm.io/package/@shopify/network

## Recent versions

- 3.3.0 (latest) — 2024-06-10
- 0.0.0-snapshot-20220623162708 (snapshot) — 2022-06-23
- 0.0.0-snapshot-release-20220622172627 (snapshot-release) — 2022-06-22
- 2.0.6-export-beta.0 (next) — 2022-02-22
- 3.2.1 — 2022-08-24
- 3.2.0 — 2022-07-04
- 3.1.0 — 2022-06-23
- 0.0.0-snapshot-20220622233020 — 2022-06-22
- 3.0.0 — 2022-05-19
- 2.0.8 — 2022-03-09
- 2.0.7 — 2022-02-25
- 2.0.6 — 2022-02-01
- 2.0.5 — 2022-02-01
- 2.0.4 — 2021-09-24
- 2.0.3 — 2021-08-24
- … 34 more at https://npm.io/package/@shopify/network/versions

## README

# `@shopify/network`

[![Build Status](https://github.com/Shopify/quilt/workflows/Node-CI/badge.svg?branch=main)](https://github.com/Shopify/quilt/actions?query=workflow%3ANode-CI)
[![Build Status](https://github.com/Shopify/quilt/workflows/Ruby-CI/badge.svg?branch=main)](https://github.com/Shopify/quilt/actions?query=workflow%3ARuby-CI)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md) [![npm version](https://badge.fury.io/js/%40shopify%2Fnetwork.svg)](https://badge.fury.io/js/%40shopify%2Fnetwork.svg) [![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/@shopify/network.svg)](https://img.shields.io/bundlephobia/minzip/@shopify/network.svg)

Common values related to dealing with the network.

## Installation

```bash
yarn add @shopify/network
```

## Usage

Import any of the enums or functions in this package to get a friendly API to common network details. The following values are exposed from this library:

- `Method`: enum for HTTP methods
- `StatusCode`: enum for HTTP status codes (mapping from name to number)
- `ResponseType`: response type enum (2xx, 3xx, etc)
- `Header`: enum for common header names
- `CspDirective`: enum for names of [content security policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) directives
- `CspSandboxAllow`: enum for values allowed in the [CSP `sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox) directive
- `SpecialSource`: enum for "special" (non-URI) sources usable in many CSP directives
- `nonceSource()`: function for generating nonce sources in CSP directives
- `getResponseType`: returns the `ResponseType` for an HTTP status code
- `HashAlgorithm`: enum for hash algorithms usable in several CSP directives
- `hashSource()`: function for generating hash sources in CSP directives

---
_Source: https://npm.io/package/@shopify/network · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
