Skip to content

Type- and runtime- safe TypeScript APIs

License

Notifications You must be signed in to change notification settings

ericcrosson-bitgo/api-ts

 
 

Repository files navigation

API-TS

Disclaimer: This project is currently in an alpha state. Documentation is actively being worked on.

A collection of packages for defining and using type-checked apis with TypeScript.

TypeScript is a very powerful type system layered on top of JavaScript, but lacks type information available at runtime. This is not likely to change because it is an explicit non-goal of TypeScript. io-ts fills in this functionality gap. io-ts-http builds on top of io-ts to make it possible to define codecs that translate between HTTP requests and plain JS objects. Additionally, it provides a way to group these codecs into route definitions, and then collect the route definitions into an api. The resulting api definitions may then be used on the client and server to have type-checked and runtime-validated HTTP calls in a standardized manner.

Getting started

npm install
npm run build
npm test

License

This work is published under the Apache 2.0 license.

SPDX-License-Identifier: Apache-2.0

About

Type- and runtime- safe TypeScript APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.6%
  • JavaScript 2.2%
  • Nix 0.2%