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-stop-server

v0.0.1

Published

DSH web plugin: a 'Stop server & close' button in the Settings panel header + a POST /api/__shutdown host route. Dual-face bundle (host half + browser half).

Readme

dsh-stop-server

DSH web profile 插件:在侧边栏底部添加一个「关闭服务」按钮,点击后优雅关闭 dsh web 服务器并尝试关闭窗口。

工作原理

双面 bundle(宿主端 + 浏览器端),不修改任何 DSH 发行版文件:

  • 宿主端 (lib/index.js):注入 webServer + appExit,注册 POST /api/__shutdown 精确路由。点击后调用 ctx.appExit(0) 优雅销毁整棵插件树(关闭 HTTP 服务器、断开所有连接),3 秒兜底强制退出。
  • 浏览器端 (lib/client.js):注入 sidebar.footer.action 插槽,在侧边栏底部(设置齿轮上方)渲染一个带 ✕ 图标的按钮。点击后 fetch(POST /api/__shutdown),然后尝试 window.close()。

文件

| 文件 | 作用 | |------|------| | package.json | dsh.bundle.patch(声明为 profile 层)+ dsh.client(浏览器端)+ exports["./client"] | | cordis.patch.yml | 一行 insert,将插件加入 profile 树 | | lib/index.js | 宿主端:注册 POST /api/__shutdown 路由 + 优雅关机 | | lib/client.js | 浏览器端:侧边栏「关闭服务」✕ 按钮 |

安装

# 从本目录安装:
dsh plugin --profile web add .

# 或从 npm 安装(发布后):
dsh plugin --profile web add dsh-stop-server

安装后重启 dsh web 生效。打开界面后,侧边栏底部(设置齿轮上方)会出现「关闭服务」按钮。

依赖

零外部 npm 依赖。inject 声明的 4 个包全部是 DSH 内置包:

  • @deepseek-ai/dsh-client-runtime(插槽服务)
  • @deepseek-ai/dsh-client-ui-settings(设置插槽声明)
  • @deepseek-ai/dsh-client-ui-settings-general(设置外壳)
  • @deepseek-ai/dsh-client-ui-primitives(Button、图标等 UI 组件)

前提条件

  • 已安装 dsh(npm i -g @deepseek-ai/dsh)
  • 已启用 pnpm(corepack enable pnpm)
  • 使用 dsh web 运行

许可证

MIT