Skip to content

Commit

Permalink
Improve CLI docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bcherny authored May 5, 2024
1 parent e8291d7 commit 6c69141
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,20 @@ json-schema-to-typescript is easy to use via the CLI, or programmatically.

### CLI

A CLI utility is provided with this package.
First make the CLI available using one of the following options:

```sh
# install locally, then use `npx json2ts`
npm install json-schema-to-typescript

# or install globally, then use `json2ts`
npm install json-schema-to-typescript --global

# or install to npm cache, then use `npx --package=json-schema-to-typescript json2ts`
# (you don't need to run an install command first)
```

Then, use the CLI to convert JSON files to TypeScript typings:

```sh
cat foo.json | json2ts > foo.d.ts
Expand Down

0 comments on commit 6c69141

Please sign in to comment.