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

rnu-node

v2026.7.12-8e29529b

Published

Self-hosted data-plane node for react-native-update servers (pushy / cresc): stores update bundles, computes diffs, serves downloads. Your files never leave your infrastructure.

Readme

rnu-node

English | 简体中文

react-native-update 服务(pushy / cresc)的自托管数据节点:热更包存储、diff 计算、下载分发全部在你自己的服务器上完成,文件数据完全不经过平台。

CLI ──直传──▶ ┌────────────── rnu-node(你的服务器)──────────────┐ ◀──下载── App / CDN
              │  对象存储(本地盘或你的 S3)+ diff worker + 下载服务 │
              └─────────────────▲──────────────────────────────────┘
                                │ 出站 WebSocket(任务下发/心跳/清单回报)
               主节点(pushy 或 cresc——只管元数据与调度,不经手文件)

特性

  • 数据全托管:上传、存储、diff、下载全在本节点;主节点只下发任务与签发上传票据。
  • 只出站连接:节点主动连接主节点,无需暴露管理端口,NAT/内网可用;只需暴露一个 HTTPS 数据端点。
  • 就地 diff:增量包在已存储全量包的节点上直接计算,与平台 worker 同源的 hdiff 实现,端上无感知。(不支持遗留 bsdiff 格式;5.99.0 之前的旧客户端自动回退整包。)
  • 零平台凭证:节点不持有任何平台账户凭证;S3 密钥(如使用)只存在你的配置文件里。吊销节点 token 即完全止损。
  • 上传/下载分离:上传打到你的源站,下载走你前置的任意 CDN;两组地址在连接时自动上报控制台,无需手工录入。
  • 控制台驱动升级:可选 selfUpdate 任务——二进制自替换,或执行你自定义的升级命令。
  • 可横向扩展、可插拔:同一节点身份可跑多副本;存储驱动与任务类型皆可扩展。

快速开始

需要 Bun ≥ 1.2。

  1. 在控制台创建节点,复制 token(只显示一次)。
  2. 安装并运行:
bun add -g rnu-node
rnu-node        # 没有配置文件?会进入交互式初始化向导逐项询问并写入

rnu-node 默认带内建 supervisor:工作进程崩溃或 selfUpdate 退出后自动拉起,无需 pm2。开机自启用 systemd(生成的 unit 带 --no-supervise,重启交给 systemd 单层监护):

rnu-node service | sudo tee /etc/systemd/system/rnu-node.service
sudo systemctl daemon-reload && sudo systemctl enable --now rnu-node

运行中的节点用以下命令运维:

rnu-node status   # 运行状态快照(exit 0 = 已连接主节点,2 = 降级,1 = 未运行)
rnu-node stop     # 优雅停止(经 pidfile 发 SIGTERM,含 supervisor 整棵进程树)
  1. 反向代理自行选择。 节点监听纯 HTTP(默认 :7420),TLS 由你现有的任何方案承担(nginx、Caddy、Traefik、云负载均衡……),uploadUrl / downloadUrls 填公网 HTTPS 地址即可。仅两点要求:完整转发请求体(上传可达数百 MB)、不要缓存 PUT
  2. 在控制台把 app 绑定到该节点。之后新上传的热更包直传本节点,checkUpdate 返回的下载地址指向你的 downloadUrls

发版

每次 push 到 master 自动发布 npm(版本号 YYYY.M.D-<commit>;若该 commit 带 vX.Y.Z tag 则用 tag 版本;dist-tag latest)。升级:bun add -g rnu-node@latest 后重启;也可由控制台通过 selfUpdate 任务代劳(upgrade.mode = "command",command 填同一条命令)。

配置

rnu-node.zh-CN.example.toml(English)。所有配置可用环境变量覆盖:RNU_SERVERRNU_TOKENRNU_UPLOAD_URLRNU_DOWNLOAD_URLS(逗号分隔)、RNU_LISTENRNU_DATA_DIRRNU_CONCURRENCYRNU_ALLOW_DELETERNU_STORAGE_DRIVERRNU_S3_ENDPOINTRNU_S3_REGIONRNU_S3_BUCKETRNU_S3_ACCESS_KEY_IDRNU_S3_SECRET_ACCESS_KEY

存储驱动

  • local(默认):dataDir 下的内容寻址文件,备份该目录即可。
  • s3:任意 S3 兼容服务(AWS S3、Cloudflare R2、MinIO、阿里云 OSS S3 兼容模式、腾讯 COS 等)。密钥不离开你的机器。默认上传、下载都不经过节点——节点只承担控制面与 diff 算力:
    • uploadMode = "presign"(默认):CLI 拿预签名 PUT URL 直传 bucket,节点在注册后异步校验大小与 sha256;proxy:经节点中转并流式校验。
    • downloadMode = "redirect"(默认):302 到预签名 URL,带宽由 bucket/其 CDN 承担;proxy:经节点转发——想在节点前面加 CDN 时用。

数据端点

| 路由 | 说明 | |---|---| | PUT /v1/objects/:key | 凭主节点签发的短时效票据上传(CLI 使用) | | GET /v1/objects/:key | 公开下载,支持 Range,immutable 缓存头,CDN 友好 | | GET /healthz | 存活探针 | | GET /metrics | Prometheus 指标 |

运维要点

  • 备份:对象是内容寻址、不可变的,备份 dataDir(或你的 bucket)即可;丢失全量包意味着对应版本不可分发。
  • 删除:节点从不自行删除业务对象;主节点的孤儿清理任务仅在 allowDelete = true 时被接受。
  • 升级:替换镜像/二进制后重启即可——断线期间的回报会在重连后补发,主节点不可达时下载服务照常;也可开启 [upgrade] 接受控制台下发的 selfUpdate 任务。

开发

bun install
bun test          # 单测 + 进程内 mock 主节点的全链路测试
bun run typecheck

控制通道协议定义见 src/control/protocol.ts(v1)——节点侧为事实来源,主节点实现与其保持同构。

License

MIT