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

@danny_lei/dsh-current-date-weekday

v1.0.0

Published

Query today's date and day of the week as a model-callable tool

Readme

@danny_lei/dsh-current-date-weekday

一个 Host-only 的 DSH 插件(组合包 bundle),安装后为模型注册 current-date-weekday 工具,用于查询「今天是几月几号、星期几」。走 DSH 的 profile bundle 机制,重启后仍然存在。

  • 查询内容:年月日、星期(中英文)、ISO 时间、IANA 时区,以及一句摘要。
  • 时间来源:Host 进程的本地时区(new Date() + Intl),返回纯 JSON。

安装

dsh plugin --profile <name> add @danny_lei/dsh-current-date-weekday

dsh plugin 是 pnpm 转发器,会把本包写入 profile 的 dependencies 并依据 dsh.bundle.patch 写进 dsh.profile.bundles。也可以直接在 profile 的 cordis.patch.yml 里手工插入:

- insert:
    - id: date-weekday
      name: '@danny_lei/dsh-current-date-weekday'

重启 dsh,模型工具列表里就会出现 current-date-weekday。

从源码构建

pnpm install
pnpm run build        # tsc 产出 lib/index.js 与 lib/index.d.ts

发布

npm publish --access public   # prepublishOnly 会先自动构建

目录结构

src/index.ts        # 插件本体:注册 current-date-weekday 工具
cordis.patch.yml    # bundle patch:插入该插件这一行
tsconfig.json       # 类型检查 + 转译(输出到 lib/)

验证

构建成功后,让模型调用一次 current-date-weekday,期望返回类似:

{
  "year": 2026,
  "month": "09",
  "day": "25",
  "date": "2026-09-25",
  "weekday": 5,
  "weekdayEn": "Friday",
  "weekdayZh": "星期五",
  "iso": "2026-09-25T12:34:56.789Z",
  "timezone": "Asia/Shanghai",
  "friendly": "今天是 2026年9月25日,星期五"
}

局限

  • 本包是 Host-only(只有模型工具 current-date-weekday),没有浏览器小部件。
  • 时间取 Host 本地时区,不区分远程用户时区。