<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Json on 春江暮客</title>
    <link>https://www.bobobk.com/en/tags/json/</link>
    <description>Recent content in Json on 春江暮客</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 17 May 2025 08:53:04 +0800</lastBuildDate>
    <atom:link href="https://www.bobobk.com/en/tags/json/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to Convert Between YAML and JSON (Complete Python/JavaScript Guide)</title>
      <link>https://www.bobobk.com/en/convert-yaml-to-json.html</link>
      <pubDate>Sat, 17 May 2025 08:53:04 +0800</pubDate>
      <guid>https://www.bobobk.com/en/convert-yaml-to-json.html</guid>
      <description>A comprehensive guide to mastering YAML and JSON conversion using Python and JavaScript, including handling complex structures, cross-language solutions, and performance optimization tips.</description>
    </item>
    <item>
      <title>在线YAML与JSON的相互转换</title>
      <link>https://www.bobobk.com/en/yaml_json/</link>
      <pubDate>Sat, 17 May 2025 08:53:04 +0800</pubDate>
      <guid>https://www.bobobk.com/en/yaml_json/</guid>
      <description>&lt;p&gt;本工具用于 YAML 与 JSON 格式的相互转换，支持格式校验与实时预览，基于 JavaScript 实现，无需后端支持，数据不上传，纯前端运行。&lt;/p&gt;&#xA;&lt;h2 id=&#34;使用方法&#34;&gt;使用方法&lt;/h2&gt;&#xA;&lt;h3 id=&#34;yaml-转-json&#34;&gt;YAML 转 JSON&lt;/h3&gt;&#xA;&lt;p&gt;在下方输入合法的 YAML 数据：&lt;/p&gt;&#xA;&lt;div&gt;&#xA;&lt;textarea id=&#34;yamlInput&#34; placeholder=&#39;name: yanzhi&#xA;age: 18&#39;&gt;&lt;/textarea&gt;&#xA;&lt;button onclick=&#34;convertToJson()&#34;&gt;转换为 JSON&lt;/button&gt;&#xA;&lt;p&gt;编码后的JSON为：&lt;/p&gt;&#xA;&lt;pre id=&#34;jsonoutputArea&#34;&gt;{&#xA;  &#34;name&#34;: &#34;yanzhi&#34;,&#xA;  &#34;age&#34;: 18&#xA;}&lt;/pre&gt;&#xA;&lt;script&gt;&#xA;function convertToJson() {&#xA;  const input = document.getElementById(&#34;yamlInput&#34;).value;&#xA;  const output = document.getElementById(&#34;jsonoutputArea&#34;);&#xA;  try {&#xA;    const obj = jsyaml.load(input);&#xA;    const json = JSON.stringify(obj, null, 2);&#xA;    output.textContent = json;&#xA;  } catch (e) {&#xA;    output.textContent = &#34;❌ YAML 解析错误: &#34; + e.message;&#xA;  }&#xA;}&#xA;&lt;/script&gt;&#xA;&lt;/div&gt;&#xA;&lt;h3 id=&#34;json-转-yaml&#34;&gt;JSON 转 YAML&lt;/h3&gt;&#xA;&lt;div&gt;&#xA;&lt;input type=&#34;text&#34; id=&#34;jsonInput&#34; oninput=&#34;convertToYaml()&#34; placeholder=&#39;{&#34;name&#34;: &#34;yanzhi&#34;, &#34;age&#34;: 18}&#39;/&gt;&#xA;&lt;button onclick=&#34;convertToYaml()&#34;&gt;转换为YAML&lt;/button&gt;&#xA;&lt;p&gt;编码后的YAML为：&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
