Skip to content

jbenner-radham/node-fetch-status-codes

Repository files navigation

fetch-status-codes

Fetch the HTTP status codes from the IANA registry.

Install

npm install fetch-status-codes

Usage

import fetchStatusCodes from 'fetch-status-codes';

await fetchStatusCodes();
// >>> [
// >>>   {
// >>>     value: 100,
// >>>     description: 'Continue'
// >>>     references: [
// >>>       {
// >>>         name: 'RFC9110, Section 15.2.1',
// >>>         url: 'https://www.rfc-editor.org/rfc/rfc9110.html#section-15.2.1'
// >>>       }
// >>>     ]
// >>>   },
// >>>   ...
// >>> ]

await fetchStatusCodes({ resolveRedirects: false });
// >>> [
// >>>   {
// >>>     value: 100,
// >>>     description: 'Continue'
// >>>     references: [
// >>>       {
// >>>         name: 'RFC9110, Section 15.2.1',
// >>>         url: 'https://www.iana.org/go/rfc9110'
// >>>       }
// >>>     ]
// >>>   },
// >>>   ...
// >>> ]

License

The BSD 3-Clause License. See the license file for details.

About

Fetch the HTTP status codes from the IANA registry.

Resources

License

Stars

Watchers

Forks

Packages

No packages published