yaml-to-json Convert YAML to JSON
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}`;
}
}