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 dedication to any extra work, 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 cliet 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 -g nestia
nestia "src/controller" --out "src/api"
If you want to see an example project using the Nestia, click below links:
Usage
Installation
There're two ways to installing the Nestia.
The first way is to installing the nestia in the global scope.
npm install -g nestia
nestia "src/controllers" --out "src/api"
The second way is to installing the nestia in the project scope with --save-dev option
npm install --save-dev nestia
npx nestia src/controllers --out src/api
CLI options
nestia <source_controller_directory> --out <output_sdk_directory>
nestia "src/controllers" --out "src/api"
nestia "src/consumers/controllers" "src/sellers/controllers" --out "src/api
To generate a SDK library through the Nestia is very easy. Just type the nestia <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.
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