# JSON diff and patch

JSON diff and patch is a command-line tool and Go library that compares JSON or YAML values, highlights added, changed, and removed data, and creates patches for developers and operators to apply those changes reliably. It is open source and self-hosted, installable on Docker Hub.

Canonical page: https://ourlocalhost.com/app/6669/json-diff-and-patch

## Description

JSON Diff and Patch is a command-line tool and Go library that compares JSON or YAML values, highlights added, changed, and removed data, and creates patches for developers and operators to apply those changes reliably.

## Platform availability

Available on 0 of 10 platforms.

## Health score

53/100 (Fair), based on 4 of 5 factors.
- Maintained: 46 (last commit 265 days ago)
- Popular: 67 (2,304 GitHub stars)
- Easy to install: 25 (0 install platforms, install notes, Docker image)
- Security check: 79 (no serious findings, CI, tests, OpenSSF Scorecard 4.8/10)

## Links

- GitHub: https://github.com/josephburnett/jd
- Docker Hub: https://hub.docker.com/r/josephburnett/jd
- Official website: http://play.jd-tool.io

## Common questions

### How do I run the built-in web UI on a custom port?

Run jd with -port=N to serve the web UI on port N. If building from source, use the Makefile to include the UI.

### Can I use jd through Docker without installing the binary?

Yes. Run the josephburnett/jd image with the current directory mounted and pass your diff or patch arguments to it.

### Can I compare YAML files instead of JSON?

Yes. Pass -yaml to read and write YAML instead of JSON.

### How do I ignore array order or small numeric differences?

Use -set for arrays as sets or -mset for multisets, and use -precision=N or -opts for numeric tolerance. PathOptions can target specific paths.

### How can I diff files in GitHub Actions and use the exit code?

Use the jd GitHub Action with the two files as args. The action exposes output and an exit code that you can test in a follow-up step.

---
Source: Our Local Host (https://ourlocalhost.com/app/6669/json-diff-and-patch), the self-hosted and open-source app directory.
