Skip to content

Commit 679d64f

Browse files
authoredDec 26, 2020
docs: add details on debugging and output control (#219)
1 parent fee112b commit 679d64f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed
 

‎README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ async function complex() {
263263
complex();
264264
```
265265

266-
## Notes
266+
## Tips & Tricks
267267

268268
### Using a proxy
269269
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.
@@ -276,6 +276,18 @@ $ linkinator "**/*.md" --markdown
276276

277277
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.
278278

279+
### Debugging
280+
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`:
281+
```sh
282+
$ linkinator https://jbeckwith.com --verbosity DEBUG
283+
```
284+
285+
### Controlling Output
286+
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!
287+
```sh
288+
$ linkinator https://jbeckwith.com --verbosity DEBUG --format JSON | jq '.links | .[] | select(.state | contains("BROKEN"))'
289+
```
290+
279291
## License
280292

281293
[MIT](LICENSE.md)

0 commit comments

Comments
 (0)
Please sign in to comment.