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

node-cf-worker

v0.1.0

Published

Cloudflare Worker compatible runtime, based on Node.js.

Readme

node-cf-worker

Cloudflare Worker 兼容运行时, 基于 Node.js.

动机

本项目使您能够在本地或任何 Node.js 兼容的基础设施上自托管服务, 解除 Cloudflare Workers 的供应商锁定.

快速开始

全局安装: npm install -g node-cf-worker

假设你的 worker 服务有以下结构:

- src/
- wrangler.toml

你只需要执行 node-cf-worker ./wrangler.toml 即可启动服务.

选项: --port 指定监听端口 (默认: 8787)

支持特性

  • R2
  • D1
  • KV
  • AI (通过配置 OpenAI 兼容服务)

技术细节

D1 通过本地的 sqlite3 模拟

KV 只是一个名为 kv 的 sqlite3 数据表

AI 通过 OpenAI 兼容 API 模拟。在 wrangler.toml 中配置:

[ai]
binding = "AI"
base_url = "http://localhost:11434"   # 可选,默认使用 OPENAI_BASE_URL 环境变量或 https://api.openai.com/v1
api_key = "sk-xxx"                     # 可选,默认使用 OPENAI_API_KEY 环境变量

# 可选:将 Cloudflare 模型 ID 映射为你的提供商模型名称
[ai.modelMapping]
"@cf/meta/llama-3.1-8b-instruct" = "llama3.1:8b"
"@cf/meta/llama-3.3-70b-instruct" = "llama3.3:70b"

优先级:toml 中的 api_key/base_url > OPENAI_API_KEY/OPENAI_BASE_URL 环境变量 > 默认值。

modelMapping 将 Cloudflare 模型 ID 翻译为你的提供商模型名称。未映射的 ID 将原样转发。

R2 sqlite3 中名为 r2 的数据表结合本地文件系统