Nestia
Automatic SDK generator for the NestJS.
Outline
If you're making a backend server with the TypeScript and NestJS, you don't need any extra dedication, for delivering Rest API to the client (front-end) developers, like writing swagger.json
comments.
Just generate a SDK library through the Nestia and deliver the SDK library to the client developers. The client developers can call your backend server API just by calling the SDK library functions with await symbol, re-using the interfaces what you've defined.
npm install --save-dev nestia
npx nestia sdk "src/controller" --out "src/api"
If you want to see an example project using the Nestia, click below links:
Usage
Installation
npm install --save-dev nestia
npx nestia sdk "src/controllers" --out "src/api"
Installing the Nestia is very easy.
Just type the npm install --save-dev nestia
command in your NestJS backend project.
CLI options
npx nestia sdk <source_controller_directory> --out <output_sdk_directory>
npx nestia sdk "src/controllers" --out "src/api"
npx nestia sdk "src/consumers/controllers" "src/sellers/controllers" --out "src/api
To generate a SDK library through the Nestia is very easy. Just type the nestia sdk <input> --out <output>
command in the console. If there're multiple source directories containing the NestJS controller classes, type all of them separating by a space
word.
npx nestia install
Also, SDK library generated by the Nestia has some dependencies like below. When you type the nestia install
command in the console, those dependencies would be automatically install and would be enrolled to the dependencies
field in the package.json