Fetch the HTTP status codes from the IANA registry.
npm install fetch-status-codesimport 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'
// >>> }
// >>> ]
// >>> },
// >>> ...
// >>> ]The BSD 3-Clause License. See the license file for details.