How to convert JSON to YAML in javascript

后端 未结 4 1066
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 11:23

I want to convert a json string to yaml format in javascript.I am trying my hand on google from last two days didnt found any solution or libraries. There are answers availa

4条回答
  •  一个人的身影
    2020-12-06 11:47

    Use the 'js-yaml' npm package! That's the one that is officially recognized by yaml.org. (If you want to be extra sure && this post is outdated, go check yaml.org yourself to see which package it recommends.) I initially used 'json2yaml' instead and got strange parsing behavior when converting json (as string) to yaml.

提交回复
热议问题