The converter parses YAML into JavaScript values and prints them as an object literal. Mappings become objects, sequences become arrays, strings use single quotes, and indentation can be set to 2 spaces, 4 spaces, or tabs.
The output is an object literal for copying into JavaScript or TypeScript configs. It does not add export syntax, and YAML comments, anchors, aliases, and formatting choices are not preserved.
Common questions and answers about this topic.
YAML uses indentation-based structure and supports comments, multi-line strings, and anchors/aliases. This tool emits a JavaScript object literal for parsed YAML data, using objects, arrays, strings, numbers, booleans, and null. It does not add JavaScript-only constructs such as functions or undefined.
Yes, the sort keys dropdown allows you to arrange all JavaScript object properties in alphabetical order (A to Z) or preserve the original key sequence from your YAML input. This sorting is applied recursively to every nesting level.
Yes, the JS object output can be indented with 2 spaces, 4 spaces, or tabs via the formatting options. Most JavaScript codebases use 2-space indentation to keep object literals concise.
No, the YAML to JS object conversion takes place entirely within your browser. Your YAML data is parsed and transformed locally with JavaScript and never leaves your device.