@konker.dev/neverthrow-r-middleware
v0.0.2
Published
Type-safe HTTP middleware system built on @konker.dev/neverthrow-r
Downloads
73
Readme
@konker.dev/neverthrow-r-middleware
Type-safe HTTP middleware system built on
@konker.dev/neverthrow-r. Composition is decorator-style:
each middleware wraps an inner handler and returns a new handler.
import type { ResultAsyncR } from '@konker.dev/neverthrow-r/types';
export type Handler<I, R, O, E> = (i: I) => ResultAsyncR<R, O, E>;The package is the ResultAsyncR-based counterpart to
@konker.dev/middleware-fp (which is built on Effect).
Included middlewares
identity/trivial— minimal decorator examples.jsonBodyParserRequest/jsonBodySerializerResponse— JSON request/response IO.bodyValidator— validates the request body against any Standard Schema validator (zod, valibot, arktype, effect/Schema, …).requestResponseLogger— logs request/response via theLoggerthreaded through theRchannel.apiGatewayProxyEventV2Adapter— adapts an AWS API Gateway HTTP API event.honoAdapter— adapts aHonoRequest.
