Skip to content

Instantly share code, notes, and snippets.

@JLarky
Last active April 11, 2025 07:58
Show Gist options
  • Save JLarky/4bee16bc0b66320921028a124870146d to your computer and use it in GitHub Desktop.
Save JLarky/4bee16bc0b66320921028a124870146d to your computer and use it in GitHub Desktop.
Debug JSON with json.pub for Astro

StackBlitz Demo

Previous version with Demo Video

How to use, add the script to your existing Debug component:

---
import { Debug } from 'astro:components';
---

<Debug json={{ myThing: 123 }} />
<script is:inline type="module" src="https://astro-debug-json.deno.dev"></script>

It will look like a normal Astro <Debug> component but with the "view on json.pub" button that opens that json in https://json.pub/ by @levelsio.

image

Because data is sent over hash part of the URL the author of that service promises not to store your json in their logs (you can trust in that as much as you want I guess).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment