Installations
npm install @neoncitylights/typed-http
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
18.4.0
NPM Version
9.0.0
Score
76
Supply Chain
89
Quality
75.2
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Download Statistics
Total Downloads
464
Last Day
1
Last Week
1
Last Month
13
Last Year
102
Bundle Size
626.00 B
Minified
275.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
0.2.0
Package Id
@neoncitylights/typed-http@0.2.0
Unpacked Size
205.33 kB
Size
43.52 kB
File Count
10
NPM Version
9.0.0
Node Version
18.4.0
Total Downloads
Cumulative downloads
Total Downloads
464
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
-35%
13
Compared to previous month
Last Year
-25.5%
102
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@neoncitylights/typed-http
A TypeScript package that provides strongly typed HTTP header names. Supports the Fetch API, XmlHttpRequest
, and the Node.js HTTP module with zero-runtime overhead.
This package uses an open-source JSON dataset by WebConcepts with slight modifications, available under concepts.json
. The script to auto-generate the TypeScript files is available under generateHttpTypes.ts
. The generated files are:
httpHeaders.ts
: 248 HTTP header typeshttpMethods.ts
: 40 HTTP method typeshttpStatusCodes.ts
: 63 HTTP status code types
Install
npm install @neoncitylights/typed-http
Documentation
Auto-generated API documentation is available.
API Reference
Note: Specific HTTP headers, methods, and status codes are omitted from the API documentation for brevity. The full list of types is available in the source code.
T
: # headers.HttpHeader • sourceT
: # headers.HttpRequestHeader • sourceT
: # headers.HttpResponseHeader • sourceT
: # headers.ForbiddenHttpRequestHeader • sourceT
: # headers.ForbiddenHttpResponseHeader • sourceT
: # methods.HttpMethod • sourceT
: # statusCodes.HttpStatusCode • sourceT
: # statusCodes.HttpInfoStatusCode • sourceT
: # statusCodes.HttpSuccessStatusCode • sourceT
: # statusCodes.HttpRedirectStatusCode • sourceT
: # statusCodes.HttpClientErrorStatusCode • sourceT
: # statusCodes.HttpServerErrorStatusCode • source
Usage
Type the Fetch API
1import '@neoncitylights/typed-http/fetch'; 2 3let request = await fetch();
Type XmlHttpRequest
1import '@neoncitylights/typed-http/xhr'; 2 3const xhr = new XMLHttpRequest(); 4xhr.addEventListener('load', (e) => console.log(xhr.responseText)); 5xhr.open('GET', 'https://www.google.com'); 6xhr.send();
Type the Node.js HTTP module
1import '@neoncitylights/typed-http/node';
License
This library is licensed under the MIT license (LICENSE-MIT
or http://opensource.org/licenses/MIT).
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

No vulnerabilities found.

No security vulnerabilities found.