Skip to content

Commit 105f5db

Browse files
committed
Fixup README
1 parent 85c3c0e commit 105f5db

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

packages/headers/README.md

+15-20
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ npm install @mjackson/headers
1919

2020
## Overview
2121

22+
The following should give you a sense of what kinds of things you can do with this library:
23+
2224
```ts
2325
import Headers from '@mjackson/headers';
2426

@@ -204,33 +206,17 @@ console.log(`${headers}`);
204206
// Accept-Language: en-US,en;q=0.9
205207
```
206208

207-
## Low-level API
208-
209-
In addition to the high-level `Headers` API, `headers` also provides a rich set of primitives you can use to work with just about any complex HTTP header value. Each header class includes a spec-compliant parser (the constructor), stringifier (`toString`), and getters/setters for all relevant attributes. Classes for headers that contain a list of fields, like `Cookie`, are `Iterable`.
210-
211-
All individual header classes may be initialized with either a) the string value of the header or b) an `init` object specific to that header.
209+
## Individual Header Utility Classes
212210

213-
The following headers are currently supported:
214-
215-
- [headers](#headers)
216-
- [Installation](#installation)
217-
- [Overview](#overview)
218-
- [Low-level API](#low-level-api)
219-
- [Accept](#accept)
220-
- [Accept-Encoding](#accept-encoding)
221-
- [Accept-Language](#accept-language)
222-
- [Cache-Control](#cache-control)
223-
- [Content-Disposition](#content-disposition)
224-
- [Content-Type](#content-type)
225-
- [Cookie](#cookie)
226-
- [Set-Cookie](#set-cookie)
227-
- [License](#license)
211+
In addition to the high-level `Headers` API, `headers` also provides a rich set of primitives you can use to work with just about any complex HTTP header value. Each header class includes a spec-compliant parser (the constructor), stringifier (`toString`), and getters/setters for all relevant attributes. Classes for headers that contain a list of fields, like `Cookie`, are iterable.
228212

229213
If you need support for a header that isn't listed here, please [send a PR](https://github.com/mjackson/remix-the-web/pulls)! The goal is to have first-class support for all common HTTP headers.
230214

231215
### Accept
232216

233217
```ts
218+
import { Accept } from '@mjackson/headers';
219+
234220
let header = new Accept('text/html;text/*;q=0.9');
235221

236222
header.has('text/html'); // true
@@ -255,6 +241,8 @@ let header = new Accept(['text/html', ['text/*', 0.9]]);
255241
### Accept-Encoding
256242

257243
```ts
244+
import { AcceptEncoding } from '@mjackson/headers';
245+
258246
let header = new AcceptEncoding('gzip,deflate;q=0.9');
259247

260248
header.has('gzip'); // true
@@ -279,6 +267,8 @@ let header = new AcceptEncoding(['gzip', ['deflate', 0.9]]);
279267
### Accept-Language
280268

281269
```ts
270+
import { AcceptLanguage } from '@mjackson/headers';
271+
282272
let header = new AcceptLanguage('en-US,en;q=0.9');
283273

284274
header.has('en-US'); // true
@@ -403,6 +393,11 @@ let header = new SetCookie({
403393
});
404394
```
405395

396+
## Related Packages
397+
398+
- [`fetch-proxy`](https://github.com/mjackson/remix-the-web/tree/main/packages/fetch-proxy) - Build HTTP proxy servers using the web fetch API
399+
- [`node-fetch-server`](https://github.com/mjackson/remix-the-web/tree/main/packages/node-fetch-server) - Build HTTP servers on Node.js using the web fetch API
400+
406401
## License
407402

408403
See [LICENSE](https://github.com/mjackson/remix-the-web/blob/main/LICENSE)

0 commit comments

Comments
 (0)