Skip to content

Commit

Permalink
feat: slight improvements to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
BelfordZ committed Jun 25, 2020
1 parent 947b324 commit 8c1a55d
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,25 @@ A Generator tool for [open-rpc](https://github.com/open-rpc/spec) APIs.

## Features:

- Multi-language
- typescript
- rust
- Can generate:
- clients for accessing your service
- server scaffolding
- Built in components for:
- Clients
- Server
- Easy to create new components

## Install

```shell
$ npm install -g @open-rpc/generator
```

## Usage

### Using it in your project

Create a generator config file

```shell
$ open-rpc-generator init
```
The generator CLI has a generate command which takes a config to run. The config specifies what components you want to make, as well as the configuration for each component.

Generate artifacts based on your config
Using the CLI's `init` command, you can walk though an interactive config builder.

```shell
$ open-rpc-generator generate -c open-rpc-generator-config.json
```
### Quick start

Usage: open-rpc-generator [options]
```sh
npm install -g @open-rpc/generator

Options:
-v, --version output the version number
-d, --document [openrpcDocument] JSON string or a Path/Url pointing to an open rpc schema (default: "./openrpc.json")
-o, --outputDir [outputDirectory] output directory that the clients will be generated into (default: "./")
--ts-name [packageName] Name that will go in the package.json for the typescript client (default: "template-client")
--rs-name [crateName] Name that will go in the crate name for the rust client (default: "template-client")
-h, --help output usage information
open-rpc-generator init
open-rpc-generator generate -c open-rpc-generator-config.json
```

### Generating an individual component
Expand All @@ -70,8 +51,6 @@ $ open-rpc-generator-client generate
-o ./generated
```

In this example the generated client is written to `./generated`

## Resources

- [@open-rpc/generator package](https://www.npmjs.com/package/@open-rpc/generator)
Expand Down

0 comments on commit 8c1a55d

Please sign in to comment.