pipr.tools
Pipes
Clean Email Strip formatting from pasted email for clean plain text Clean AI Output Clean plain text from ChatGPT or AI output Decode & Format JWT Decode a JWT and pretty-print header and payload Word Frequency Count word frequency in text

yaml-to-json Convert YAML to JSON

⟐ Data
Input0 chars
Output0 chars

Examples

Convert a YAML config to JSON

Usage
"name: Alice
age: 30
roles:
  - admin
  - editor" | yaml-to-json

Convert a Kubernetes YAML manifest to JSON for tooling

Usage
"apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-ap..." | yaml-to-json

Convert a static site config from YAML to JSON

Usage
"title: My Site
baseurl: /blog
build:
  output: dist
  minify..." | yaml-to-json
View source
async (input)=>{
                try {
                    const yaml = await import('js-yaml').then(async (m)=>{
                        await m.__tla;
                        return m;
                    });
                    return JSON.stringify(yaml.load(input), null, 2);
                } catch (e) {
                    return `Error: ${e.message}`;
                }
            }