Skip to content

Support --format JSON or similar for outputΒ #192

@AgentEnder

Description

@AgentEnder

I've recently started using hyperlink to validate my static sites internal links πŸŽ‰ - it works really well. But I've got some requests from real world usages that I'm going to file issues for.

Current Behavior

The output for hyperlink is not machine parseable, so its hard to wire up checks that may accept some known errors or inconsistencies. For example, I currently have a site that reports the following error output:

./dist/client/404.html
  error: bad link /404

./dist/client/_redirects
  error: bad link /roster/@slug/matches/1

Both of these resolve to known good files. To continue using the package, I am wrapping the command in a script that checks if these are the only 2 failures and exits with code 0, else prints the output and exits with code 1.

Expected Behaviour

When passed --json the tool reports a JSON structure over stdout that is easier to handle with jq or similar processing pipelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions