DEV Community

Lazy coder
Lazy coder

Posted on

Convert object to Yaml by loading js lib

Convert object to Yaml


$.getScript('https://unpkg.com/js-yaml@4.1.0/dist/js-yaml.min.js');
copy(jsyaml.dump(myObject));
Enter fullscreen mode Exit fullscreen mode

Convert object to JSON

copy(JSON.stringify(myObject));
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Jetbrains Survey

Calling all developers!

Participate in the Developer Ecosystem Survey 2025 and get the chance to win a MacBook Pro, an iPhone 16, or other exciting prizes. Contribute to our research on the development landscape.

Take the survey

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️