@ts-rest/express
TypeScript icon, indicating that this package has built-in type declarations

3.16.0 • Public • Published

ts-rest

RPC-like client and server helpers for a magical end to end typed experience

langue typescript Github Workflow Status npm License Bundle Size Discord

Introduction

ts-rest provides an RPC-like client side interface over your existing REST APIs, as well as allowing you define a separate contract implementation rather than going for a 'implementation is the contract' approach, which is best suited for smaller or simpler APIs.

If you have non typescript consumers, a public API, or maybe want to add type safety to your existing REST API? ts-rest is what you're looking for!

Features

  • End to end type safety 🛟
  • Magic RPC-like API 🪄
  • Tiny bundle size 🌟 (1kb!)
  • Well-tested and production ready
  • No Code Generation 🏃‍♀️
  • Zod support for body parsing 👮‍♀️
  • Full optional OpenAPI integration 📝

Quickstart

Install the core package

yarn add @ts-rest/core
# Optional react-query integration
yarn add @ts-rest/react-query
# Pick your backend
yarn add @ts-rest/nest @ts-rest/express
# For automatic server OpenAPI gen
yarn add @ts-rest/open-api

Create a contract, implement it on your server then consume it in your client. Incrementally adopt, trial it with your team, then get shipping faster.

👉 Read more on the official Quickstart Guide👈

Star History

Star History Chart

Contributors

Thanks goes to these wonderful people (emoji key):

Youssef Gaber
Youssef Gaber

💻 🤔 ⚠️
Per Hermansson
Per Hermansson

📖 💻
Grégory Houllier
Grégory Houllier

📖
Michael Angelo
Michael Angelo

📖
Pieter Venter
Pieter Venter

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

none

Install

npm i @ts-rest/express@3.16.0

Version

3.16.0

License

none

Unpacked Size

32.5 kB

Total Files

10

Last publish

Collaborators

  • oliverbutler