ts-api-decorators
v0.2.30
Published
API Decorators for typescript
Downloads
64
Readme
Typescript API Decorators
This library provides a simple way to use typescript decorators to define APIs. The benefits of this approach are many-fold:
- Automatic Runtime Type Safety and Validation: The library automatically checks that inputs you accept comply with the type definitions in your code. Extended validation also supports deep, customizable validation that helps you simplify your handlers while making them robust.
- Easy Logging and Security: A built in hook system allows you to easily write functions that execute around your handlers - providing simple ways to perform logging or integrate security mechanisms.
- Platform-Agnostic Implementation: You can easily compile the same API code to work in many environments: an Express web server, an Azure Function, ...
- Automatic Swagger Generation: The library provides tools to automatically generate swagger definitions for your API, which can be used to automatically generate client SDKs.
- API Validation: The library can be run in a type checking mode that ensures that all API responses conform to specification.
Quick Start
To get started, check out the library for the transport or hosting technology of your choice.