Skip to content

Commit

Permalink
docs: update usage in README (#290)
Browse files Browse the repository at this point in the history
* refactor: update readme

* docs: change language in examples to console
  • Loading branch information
aarondill committed Feb 1, 2023
1 parent df3e8f3 commit 07820db
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ npm install --global sort-package-json

### Usage

```bash
```console
$ cd my-project
$ cat package.json
{
Expand All @@ -39,6 +39,9 @@ $ cat package.json
$ npx sort-package-json
package.json is sorted!

Found 1 file.
1 file successfully sorted.

$ cat package.json
{
"name": "my-awesome-project",
Expand All @@ -62,17 +65,19 @@ $ sort-package-json "package.json" "packages/*/package.json"

When you want to check if your files are sorted, you can run CLI with the `--check` flag (or `-c`). This will output a list of not sorted files, if any.

```bash
```console
$ sort-package-json "**/package.json" --check

# 5 matched files are sorted.

Found 5 files.
5 files were already sorted.

$ sort-package-json "**/package.json" --check
# foo/package.json
# bar/package.json
foo/package.json
bar/package.json

# 2 of 5 matched files are not sorted.
Found 5 files.
3 files were not sorted.
2 files were already sorted.
```

#### `--quiet` flag
Expand Down

0 comments on commit 07820db

Please sign in to comment.