|
1 | | -# OpenAPI NodeJS CLI |
| 1 | +[](https://github.com/corunet/openapi-nodejs-cli/blob/main/LICENSE) |
2 | 2 |
|
3 | | -This generator requires the Node version >=17.7.1 to run properly |
| 3 | +[Summary](#summary) · [Getting started](#getting-started) · [Support](#support) · [License](#license) |
4 | 4 |
|
5 | | -## Install dependencies |
| 5 | +## 📜 Summary |
| 6 | +`openapi-nodejs-cli` is a typescript code generator from an OpenApi document. |
6 | 7 |
|
7 | | -To install dependencies run: |
8 | | -`npm i` |
| 8 | +`openapi-nodejs-cli` can generate nodejs, typescript client and Angular client methods from an OpenApi document. |
9 | 9 |
|
10 | | -## Build |
11 | 10 |
|
12 | | -Build the project with `npm run build` |
| 11 | +## 🚀 Getting Started |
13 | 12 |
|
14 | | -## Usage |
| 13 | +### How to install |
15 | 14 |
|
16 | | -To view usage of the cli run: |
| 15 | +```bash |
| 16 | +npm i @corunet/openapi-nodejs-cli --global |
| 17 | +``` |
17 | 18 |
|
18 | | -`npm start -- -h` |
| 19 | +### 🧑🏻💻 Usage |
19 | 20 |
|
20 | | -### Options |
| 21 | +```bash |
| 22 | +openapi-nodejs-cli input/schema.yaml |
| 23 | +``` |
21 | 24 |
|
22 | | -- `-i <string...>`: list of URLs and/or directories to the list of OpenAPI specification used to generate the code |
23 | | -- `--allowed-paths <string..>`: list of paths allowed to be used to generate the code |
24 | | -- `--client`: generate client code only |
25 | | -- `--server`: generate server code only |
| 25 | +You can retrieve an option list with this command: |
| 26 | +``` |
| 27 | +openapi-nodejs-cli --help |
| 28 | +``` |
26 | 29 |
|
27 | | -If `--client` and `--server` are not set, both client and server code will be generated. |
| 30 | +``` |
| 31 | +Usage: openapi-nodejs-cli [options] |
28 | 32 |
|
29 | | -### Examples |
| 33 | +Options: |
| 34 | + -V, --version output the version number |
| 35 | + -i, --input <string...> OpenAPI spec URLs or directories |
| 36 | + -o, --output <string...> Output folder |
| 37 | + --client only generate client code |
| 38 | + --server only generate server code |
| 39 | + --angular generate client code for Angular |
| 40 | + -h, --help display help for command |
| 41 | +``` |
| 42 | +## 🧰 Support |
30 | 43 |
|
31 | | -- Generate code from 2 OpenAPI specification files (URLs) |
| 44 | +We’ll be glad to talk and discuss how `openapi-nodejs-cli` can help you 😊 |
32 | 45 |
|
33 | | - `npm start -- -i http://127.0.0.1:8080/kafka.yaml http://127.0.0.1:8080/schemaRegistry.yaml` |
| 46 | +Reach us through [GitHub issues](https://github.com/corunet/openapi-nodejs-cli/issues), [email](mailto:[email protected]) or [Twitter](https://twitter.com/corunet). |
34 | 47 |
|
35 | | -- Only generate client code from 1 file form a directory using only the given path |
| 48 | +## License |
36 | 49 |
|
37 | | - `npm start -- -i /Users/user/specification/kafka.yaml --allowed-paths /kafka --client` |
| 50 | + |
| 51 | + |
| 52 | +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at [https://mozilla.org/MPL/2.0/](https://mozilla.org/MPL/2.0/). |
| 53 | +[](https://github.com/corunet/openapi-nodejs-cli/blob/main/LICENSE) |
0 commit comments