npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-json-yaml-toolkit

v0.2.0

Published

Structured data toolkit for DeepSeek Harness: JSON/YAML/TOML conversion, dot-path query, and JSON Schema validation.

Downloads

213

Readme

dsh-json-yaml-toolkit

结构化数据工具箱(v0.1.0):JSON/YAML/TOML 互转、点路径查询、JSON Schema 校验。

安装

npm install dsh-json-yaml-toolkit

工具

convert_format

| 参数 | 类型 | 说明 | |------|------|------| | to | string | 必填,目标格式:json / yaml / toml | | text | string | 源内容(与 file 二选一,优先) | | file | string | 源文件路径(工作目录内) | | from | string | 可选,源格式;缺省自动嗅探 |

TOML 对顶层嵌套数组/null 支持有限:转换时做往返校验,有信息损失会输出 ⚠ 警告。

query_json

点路径查询,源格式自动嗅探(JSON/YAML/TOML):

  • address.city — 取字段
  • tags.0 — 数组下标
  • users[*].name — 通配展开数组(支持嵌套,如 a[*].b[*] 扁平展开)
  • 单值直接返回;多值编号列表;无匹配提示 0 项(查询语义不报错)

validate_schema

| 参数 | 类型 | 说明 | |------|------|------| | data | string | 待校验数据(JSON/YAML/TOML 自动嗅探) | | schema | string | JSON Schema(JSON 或 YAML 字符串) |

校验失败时列出全部错误路径与原因(ajv,allErrors 模式)。

安全与限制

  • 文件路径必须在工作目录内
  • 输入上限 1MB;输出超 10000 字符自动截断
  • 依赖:yamlsmol-tomlajv(均轻量、同步 API)

测试

npm test

覆盖三种格式互转往返、嗅探、点路径/通配/嵌套通配查询、schema 通过与失败措辞、路径越界拒绝等 26 项断言。

版本历史

0.2.0(2026-09-13)

  • 新增 diff_data 工具:递归比对两份 JSON/YAML/TOML,报告增/删/改路径与新旧值
  • 新增 convert_csv 工具:CSV↔JSON 互转(RFC 4180 引号转义、跨行字段、类型推断、前导零保真)

Roadmap(v0.3 候选)

  • JSONPath 完整语法(过滤器/通配符)
  • CSV 导出 quote 风格与分隔符自定义
  • YAML 多文档(--- 分隔)支持