Skip to content

Commit

Permalink
Document check/diff example for stdio usage
Browse files Browse the repository at this point in the history
  • Loading branch information
imme-emosol authored Oct 12, 2024
1 parent ae5ba5f commit 98143b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ To read from `stdin` and output the result to `stdout` use the `--stdin` flag.
$ cat package.json | sort-package-json --stdin
```

This can, for instance, be used to generate a diff before changing `package.json`.

```bash
$ ( PKG="./package.json" ; cat "${PGK?}" | pnpm sort-package-json --stdin | diff "${PKG?}" - ; )
```

## API

### Install
Expand Down

0 comments on commit 98143b9

Please sign in to comment.