Follow

How do you convert json into yaml? It's actually quite simple just put three dashes and a line break in front of your json and you're good to go ✅

This solved a real problem that I had at work and I'm still not over how wrong this feels. But it does work.

I have a script that prints a bunch of yaml to stdout, but one of the files it reads is json. Instead of doing anything sophisticated simply prefixing that yaml document header is enough to make everything ok.

Sign in to participate in the conversation
Mastodon

Mastodon Community of Denmark (MCD) is a joke because the mcd.dk domain was available. This instance is a near-single user instance.