@orkestrel/middleware 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,19 @@
1
1
  # @orkestrel/middleware
2
2
 
3
- Batteries for the `@orkestrel/server` middleware seam — the frozen
4
- `MiddlewareHandler<TState>` / `compose` contract and its substrate ship
5
- policy-free; this package supplies the policies the server deliberately does
6
- not: boundary rendering, telemetry, compression, security headers, CORS,
7
- deadlines, trusted-proxy client facts, ETag, bearer auth, rate limiting, body
8
- parsing, sessions, CSRF, static files, and multipart uploads each a typed
9
- `options => MiddlewareHandler<TState>` factory over the shipped seam.
3
+ > Batteries for the `@orkestrel/server` middleware seam:
4
+ > `create{Noun}(options) => MiddlewareHandler<TState>` factories for error
5
+ > boundaries, telemetry, compression, security headers, CORS, deadlines,
6
+ > trusted-proxy client facts, ETag, bearer authentication, rate limiting, body
7
+ > parsing, sessions, and CSRF in the fetch-native core, plus in-memory assets,
8
+ > static files, streaming multipart uploads, and a `node:zlib` compression
9
+ > sibling in the node face.
10
+
11
+ Mount the batteries your threat model needs over the `compose` seam: each one
12
+ closes over its guarded options and returns a `MiddlewareHandler<TState>`, and
13
+ its position in the chain decides what it can see. Read
14
+ [`guides/middleware.md`](guides/middleware.md) for the ordering doctrine and
15
+ the security acceptance bar before you fix an order. Part of the `@orkestrel`
16
+ line.
10
17
 
11
18
  ## Install
12
19
 
@@ -16,11 +23,11 @@ npm install @orkestrel/middleware @orkestrel/server
16
23
 
17
24
  ## Requirements
18
25
 
19
- - Node.js >= 24
26
+ - Node.js >= 22.12.0
20
27
  - `@orkestrel/server` as a peer dependency (the seam and substrate are
21
28
  imported, never bundled)
22
- - ESM core (`.`); a CJS node face (`./server`) for the node-bound batteries
23
- (`createStatic`, `createMultipart`)
29
+ - Dual ESM and CommonJS entries: the core (`.`) and the node face (`./server`),
30
+ which carries the node-bound batteries
24
31
 
25
32
  ## Usage
26
33
 
@@ -40,15 +47,13 @@ const handle = compose<State>([boundary, security], async (_request, context) =>
40
47
  ```
41
48
 
42
49
  Each battery is a typed `options => MiddlewareHandler<TState>` factory that composes with
43
- the others through the frozen `@orkestrel/server` seam mount boundary, telemetry,
44
- compression, security headers, CORS, rate limiting, sessions (with `MemorySessionStore` or
45
- `DatabaseSessionStore` over `@orkestrel/database`), CSRF, static files, and multipart uploads
46
- in any combination, scoped with `only()` / `except()` where needed.
50
+ the others through the frozen `@orkestrel/server` seam, in any combination, scoped with
51
+ `only()` and `except()` where needed.
47
52
 
48
53
  ## Guides
49
54
 
50
55
  See [`guides/README.md`](./guides/README.md) for the concept and dependency
51
- index; the full battery-by-battery surface docs land in `guides/src/middleware.md`
56
+ index; the full battery-by-battery surface docs land in `guides/middleware.md`
52
57
  alongside the implementation.
53
58
 
54
59
  ## License