never-rest

Documentation

An opinionated architectural choice — never-rest puts Result-based railway-oriented programming at the API boundary. Whether either side uses railway style internally is up to that team; the contract assumes at least one side wants Result at the edge.

A ContractDef where handlers return Result instead of throwing. serve projects that onto HTTP. ./local runs the same contract in-process, or behind a host that already carries the operation as a string. Errors carry their cause chain across boundaries. Disclosure is graded by caller trust.

DocTopic
ConceptsRailway at the boundary, HTTP and local transports, no middleware, errors as data, trust circles
Railway patternsFull railway/neverthrow pattern catalogue + white-label tenant kitchen sink
Advanced usagePolicy without middleware — capabilities, composers, host wraps, agents
API referenceEvery public export, signature, example — including ./local
ExamplesExpress, Next, SvelteKit, Hono, Workers, gateway, files-and-streams
Files and streamsJSON on the railway; multipart and SSE on the host
Errors as intelligencenextStep, origin, retryable, ctx, gateway chains
Comparisonvs ts-rest, oRPC, tRPC, and Hono RPC
MigratingFrom ts-rest, oRPC, throwing handlers
Type performanceInstantiation budget and CI gate

Package: @eddy-works/never-rest · Source: project-eddy/never-rest

On this page