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

@elinpf/dsh-ops-access-prometheus

v0.4.1

Published

Ops access provider for Prometheus — validates prometheus registry entries (server URL + optional bearer-token file) and expands the token path.

Readme

@elinpf/dsh-ops-access-prometheus

运维模式 Prometheus 凭证 provider — 校验 prometheus 注册表条目(服务器 URL + 可选 bearer token)并展开 token 路径。

功能

按 ops-access 三角色拆分,一种凭证一个 provider:core 拥有注册表和 ctx.opsAccess 服务;本包只提供 prometheus 这一种 — 一个 zod 条目 schema 加字段处理。

  • 条目 schema:{ url, token? } — url 是 Prometheus 服务器的 base URL(仅 http(s))。token 是可选的 bearer-token 内容:管理 UI / register_access 接受粘贴的 token,core 将其写入 ~/.dsh-ops/credentials/ 下的受管文件并存路径 — token 本身不进注册表。
  • process:剥掉 URL 末尾的斜杠,展开 token 路径开头的 ~。
  • validateContent:保存时的粘贴防护 — token 必须是单行(它会原样进 Authorization 头,内部换行会在请求时失败)。只查结构,不做连通性检查。
  • 无能力探测:Prometheus HTTP API 天然只读(query/query_range),没有 ro/rw 之分可核验。knownLimits 写明这一点,并提示与同集群的 k8s 档案配对使用。

安装

ops preset 的 agent.cordis.yml 中的 provider 行:

- id: ops-access-prometheus
  name: '@elinpf/dsh-ops-access-prometheus'

注册走 registerAccessProvider(延迟 ctx.inject + effect 生命周期,HMR 可卸载)— 绝不静态 inject opsAccess,那会死锁加载器。

测试

npm run build      # tsc → lib/
npx vitest run     # schema、process、粘贴防护、注册/HMR 卸载

无需服务器:全部测试只打纯 provider 对象和 mock 挂载。