Skip to content

Commit 1ce9e6b

Browse files
committed
docs(README):
1 parent 18e9d51 commit 1ce9e6b

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,47 @@ Angular REST API client generator from Swagger YAML or JSON file with camel case
44
# Description
55
This package generates a Angular TypeScript classes from a Swagger v2.0 specification file. The code is generated using Mustache templates.
66

7-
The generated service class uses new [HttpClient](https://angular.io/guide/http) module of Angular 4.
8-
9-
# How to get it working
7+
The generated service class uses new [HttpClient](https://angular.io/guide/http) module of Angular (introduced in version 4.3).
108

9+
# Local usage
1110
## Installation
1211

13-
`git clone https://github.com/flowup/ngx-swagger-client-generator`
12+
`yarn add @flowup/ngx-swagger-client-generator`
1413

15-
`cd ngx-swagger-client-generator`
14+
or
1615

17-
`yarn` or `npm install`
16+
`npm install @flowup/ngx-swagger-client-generator`
1817

1918
## Usage
2019

21-
`npm run generate -- -s ./path/to/swagger.[yaml|json]`
20+
- for quick usage create run script in your `package.json` scricpts
21+
```
22+
"scripts": {
23+
"generate-api-client": "ngx-swag-client -s ./swagger.yaml -o ./output-folder"
24+
},
25+
```
26+
- then just run
27+
28+
`npm run generate-api-client`
2229

2330
## Options
2431

25-
- `s` - path to the swagger file
32+
- `s` - path to the swagger file (yaml or json)
2633
- `o` - path where the generated files should be emitted
2734

28-
## Example usage:
35+
# Global usage:
36+
37+
## Installation
38+
39+
`[sudo] yarn global add @flowup/ngx-swagger-client-generator`
40+
41+
or
42+
43+
`[sudo] npm install -g @flowup/ngx-swagger-client-generator`
44+
2945
This command will generate API client described in swagger.json file to ./output folder
3046

31-
`npm run generate -s ./path/to/swagger.json -o ./output`
47+
`ngx-swag-client -s ./path/to/swagger.json -o ./output`
3248

3349
## Note:
3450
This project was inspired by [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) project.

0 commit comments

Comments
 (0)