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-case

v0.1.0

Published

DSH plugin: case/naming conversion tool (case_convert).

Readme

dsh-case

DSH 插件:命名/大小写风格转换工具,注册一个 case_convert 工具。

纯 ESM、零依赖、无构建步骤。

安装

dsh plugin --profile <name> add file:./plugins/dsh-case
# 或发布后
dsh plugin --profile <name> add dsh-case

工具 case_convert

参数:

| 参数 | 类型 | 必填 | 说明 | |---|---|---|---| | text | string | 是 | 待转换文本 | | target | string(enum) | 是 | 目标风格 | | source | string(enum) | 否 | 源风格,默认 auto 自动检测 |

返回值(规范 JSON 对象):

{ "input": "...", "target": "camelCase", "source": "snake_case", "output": "...", "words": ["..."] }

各 target 示例

以 hello_world(snake_case)为输入:

| target | 输出 | |---|---| | camelCase | helloWorld | | PascalCase | HelloWorld | | snake_case | hello_world | | kebab-case | hello-world | | CONSTANT_CASE | HELLO_WORLD | | UPPER | HELLO WORLD | | lower | hello world | | Title Case | Hello World |

分词规则

  1. 按分隔符 -、_、空白、. 切词。
  2. 在无分隔符片段内按大小写边界切词:
    • 小写 → 大写(helloWorld → hello / World)
    • 连续大写后接小写(HTTPApi → HTTP / Api)
    • 数字后接「大写 + 小写」(my2Factor → my2 / Factor)
  3. 数字粘合到相邻单词,不单独成词:version2 → version2;开头的 2FA 保持为一个整体不拆分。
  4. 空输入或纯符号输入原样返回,words 为空数组。

source 用于 auto 检测时的判定(分隔符 + 连续大写规则);分词算法对全部分隔符与大小写边界一视同仁,因此 source 主要作为结果中的标注,不影响转换正确性。