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)