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

ones-fetch

v1.4.5

Published

ONES Fetch — Web app for recursive ONES subtask crawling

Readme

ONES 子任务采集工具

一个本地 Web 工具,用浏览器界面批量解析 ONES 任务链接或任务编号,并递归抓取所有子任务。

快速安装(推荐)

策划电脑上已有 Node.js,执行一条命令即可:

npx ones-fetch@latest install

或者使用 npm 安装:

npm install -g ones-fetch

这会自动:

  • 安装依赖(约 30MB,仅首次需要)
  • 在桌面创建快捷方式
  • 完成后双击桌面图标即可使用

注意

  • 依赖只需安装一次,后续启动无需重新安装
  • 服务器会在浏览器关闭 2 分钟后自动退出
  • 解析任务时会显示实时进度(1/7)

环境要求

  • Node.js 18+
  • Chrome 或 Edge 浏览器(系统已安装)
  • 可访问的 ONES 租户 URL

手动安装

git clone <repo-url>
cd ones-fetch
npm install

使用方法

方式 1:双击启动(推荐给非技术用户)

Windows 用户:

  • 双击桌面 ONES 采集工具.lnk
  • 浏览器会自动打开工具页面

方式 2:命令行启动

npm start
# 或开发模式(自动重启)
npm run dev

启动后会自动打开浏览器访问 http://localhost:36781

使用流程

  1. 首次使用 - 连接 ONES

    • 页面会提示"连接 ONES"
    • 点击后会打开浏览器登录页
    • 登录完成后,系统会自动捕获认证信息和 team-id
  2. 粘贴任务文本

    • 支持粘贴完整 ONES 任务链接
    • 也支持直接粘贴 #90182|#90183 这种编号文本
    • 页面会自动提取任务编号并递归抓取所有子任务
  3. 查看结果

    • 任务列表会显示所有子任务
    • 包含任务编号、标题、状态、负责人、截止日期等信息

技术说明

认证机制

  • 首次登录时,系统会启动浏览器窗口
  • 自动从页面 URL 提取 team-id(格式:/team/{uuid}/...
  • 认证信息保存在 ~/.ones-fetch/credentials.json(权限 600)
  • 令牌过期时会提示重新登录

Web API

服务提供以下接口:

| 方法 | 路径 | 说明 | |---|---|---| | GET | / | Web UI 首页 | | GET | /api/auth/status | 当前认证状态 | | POST | /api/auth/login | 启动浏览器登录采集 | | POST | /api/crawl | 批量采集接口 |

/api/crawl 请求格式:

{
  "taskIds": ["90182", "90183", "HM6gttraKPOVnrdy"],
  "baseUrl": "https://your-team.ones.cn",
  "teamId": "<team-uuid>"
}

响应格式:

{
  "roots": ["<uuid1>", "<uuid2>"],
  "tasks": [
    { "uuid": "...", "root_uuid": "<uuid1>", "number": "...", "summary": "...", ... },
    ...
  ]
}

错误时返回 401(需要登录或令牌过期)或 500(采集失败)。


环境变量

可选的环境变量:

| 变量 | 说明 | |---|---| | PORT | 服务端口(默认 36781) | | ONES_BASE_URL | ONES 基础 URL | | ONES_TEAM_ID | 团队 UUID(通常自动检测) |


本地凭证文件

| 路径 | 用途 | |---|---| | ~/.ones-fetch/credentials.json | 登录时保存的认证令牌(权限 600) |


项目结构

ones-fetch/
├── bin/
│   └── install.mjs     # 安装依赖及快捷方式
├── src/
│   ├── server.mjs      # HTTP 服务器和任务爬取逻辑
│   └── auth.mjs        # 浏览器登录和凭证管理
├── public/
│   └── index.html      # Web UI 界面
└── package.json