• 请不要在回答技术问题时复制粘贴 AI 生成的内容
BlueSky335
V2EX  ›  程序员

自己撸了个简单的 JSON 格式化工具

  •  
  •   BlueSky335 · Apr 12, 2022 · 4126 views
    This topic created in 1665 days ago, the information mentioned may be changed or developed.

    一时兴起,试用 Vite 的时候顺手撸了个小工具。

    在线版部署在 GitHub Pages 上,同时上传了 Docker 镜像,方便一键部署。

    截图预览

    preview

    Supplement 1  ·  Apr 18, 2022

    更新

    • 添加了展开收起动画
    • 添加了Code mirror编辑器
    • 当值是字符串,且内容为JSON字符串时可展开预览
    12 replies  •  2022-04-18 00:55:30 +08:00
    x86
    x86
    Apr 12, 2022❤️2
    1
    v2 人均一个在线工具和导航...
    JFZ
    JFZ
    Apr 12, 2022
    2
    自用的 四行代码实现 哈哈 https://file.jfz.xyz/json.html
    afewok
    afewok
    Apr 13, 2022
    4
    我来提个要求吧,字符串里的 json 支持格式化
    比如:"{\"key\":\"value\"}"
    karott7
    karott7
    Apr 13, 2022
    5
    为什么只格式格式化第一层 json ?之前用搜索出来的第一个 json 格式网站也是
    Jekins
    Jekins
    Apr 13, 2022
    6
    utools 路过哈哈哈
    oppoic
    oppoic
    Apr 13, 2022
    7
    我做成了浏览器插件,断网也可以用

    https://chrome.google.com/webstore/detail/jsonviewer/khbdpaabobknhhlpglenglkkhdmkfnca
    另外,一个窗口最多支持 6 段 JSON 同时格式化
    BlueSky335
    BlueSky335
    OP
    Apr 13, 2022
    9
    @karott7 不会啊,会递归解析每一层啊,你看截图
    mlhadoop
    mlhadoop
    Apr 13, 2022
    10
    @x86 哈哈,这现象的确是有点意思
    karott7
    karott7
    Apr 13, 2022
    11
    @BlueSky335 "{"message":"aaaa","rspData":"{\"message\":\"bbbbb\",\"statusCode\":\"POSTED\"}","statusCode":"POSTED"}"

    你复制看吧
    BlueSky335
    BlueSky335
    OP
    Apr 18, 2022
    12
    @karott7 已经更新了代码,支持了你这种情况。顺便添加了一些动画和优化了编辑器
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1388 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 70ms · UTC 20:16 · PVG 04:16 · LAX 12:16 · JFK 15:16
    ♥ Do have faith in what you're doing.