Skip to content

Commit

Permalink
docs: add details on debugging and output control (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Dec 26, 2020
1 parent fee112b commit 679d64f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Expand Up @@ -263,7 +263,7 @@ async function complex() {
complex();
```

## Notes
## Tips & Tricks

### Using a proxy
This library supports proxies via the `HTTP_PROXY` and `HTTPS_PROXY` environment variables. This [guide](https://www.golinuxcloud.com/set-up-proxy-http-proxy-environment-variable/) provides a nice overview of how to format and set these variables.
Expand All @@ -276,6 +276,18 @@ $ linkinator "**/*.md" --markdown

Without the quotes, some shells will attempt to expand the glob paths on their own. Various shells (bash, zsh) have different, somewhat unpredictable behaviors when left to their own devices. Using the quotes ensures consistent, predictable behavior by letting the library expand the pattern.

### Debugging
Oftentimes when a link fails, it's an easy to spot typo, or a clear 404. Other times ... you may need more details on exactly what went wrong. To see a full call stack for the HTTP request failure, use `--verbosity DEBUG`:
```sh
$ linkinator https://jbeckwith.com --verbosity DEBUG
```

### Controlling Output
The `--verbosity` flag offers preset options for controlling the output, but you may want more control. Using [`jq`](https://stedolan.github.io/jq/) and `--format JSON` - you can do just that!
```sh
$ linkinator https://jbeckwith.com --verbosity DEBUG --format JSON | jq '.links | .[] | select(.state | contains("BROKEN"))'
```

## License

[MIT](LICENSE.md)

0 comments on commit 679d64f

Please sign in to comment.