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

@xinggao/cloudpipe

v0.1.1

Published

Serverless Cloudflare tunnels for Node.js — no backend, no auth, no cloudflared install.

Readme

cloudpipe (Node.js)

Serverless Cloudflare tunnels for Node.js — no backend, no auth, no cloudflared install. Same shape as @ngrok/ngrok, backed by your own Cloudflare account.

Install

npm install @xinggao/cloudpipe

Prebuilt binaries are shipped for macOS (arm64 + x64), Linux (x64-gnu), and Windows (x64-msvc). Linux aarch64-gnu and Alpine/musl support are scheduled for v0.2.0 — see the workflows' matrix entry for the upstream zig-cross-compile setup we still need to land.

Quick start

import { connect } from '@xinggao/cloudpipe';

const listener = await connect({
  token: process.env.CLOUDFLARE_API_TOKEN,
  domain: 'example.com',
  port: 8080,
});

console.log(`live at ${listener.url}`);
// ... later ...
await listener.close();

No other binary needs to be installed — cloudflared is downloaded on first use to ~/.cfp/bin/cloudflared (with a default GitHub mirror for users behind the GFW; override with CFP_GITHUB_PROXY).

Lifecycle events

Subscribe to the same lifecycle events the CLI exposes:

listener.on('creatingTunnel', (json) => {
 const { name } = JSON.parse(json);
 console.log(`creating tunnel ${name}`);
});

listener.on('edgeConnected', (json) => {
 const { connIndex, total } = JSON.parse(json);
 console.log(`edge connection ${connIndex}/${total}`);
});

listener.on('shuttingDown', (json) => {
 console.log('shutting down:', JSON.parse(json).reason);
});

The complete event-name catalog is documented in index.d.ts. Each callback receives the event payload as a JSON string — JSON.parse it inside the handler to access fields.

API

connect(options) → Promise<Listener>

| Field | Type | Default | Notes | |---|---|---|---| | token | string | — | Required. Cloudflare API token. | | domain | string | auto | Base domain. Auto-discovered when the token has access to exactly one zone. | | protocol | 'http' | 'https' | 'tcp' | 'udp' | 'ssh' | 'http' | Local service scheme. | | port | number | 8080 | Local port to expose. | | subdomain | string | random | Desired subdomain. | | autoRestart | boolean | false | Respawn cloudflared on the same URL after a crash. | | cloudflaredPath | string | — | Use a specific cloudflared binary instead of downloading. | | githubProxy | string | https://v4.gh-proxy.org/ | GitHub mirror prefix for the cloudflared download. |

Listener

| Member | Type | Notes | |---|---|---| | url | string | Public HTTPS URL of the tunnel. | | fullName | string | Public hostname (myapp.example.com). | | subdomain | string | Just the subdomain part. | | on(event, cb) | (name, payload) → void | Register an event listener. | | wait() | Promise<void> | Block until the tunnel exits on its own. | | close() | Promise<void> | Trigger clean shutdown + wait. |

Errors

cloudpipe does not subclass the JS Error — the cloudpipe-specific taxonomy is encoded as a [CODE] prefix on error.message (optionally with a :KIND sub-class for CLOUDFLARE_API, e.g. [CLOUDFLARE_API:RATE_LIMITED]). Use the exported parseErrorCode helper to extract the code without hand-rolling a regex:

import { connect, parseErrorCode } from '@xinggao/cloudpipe';

try {
 await connect({ token });
} catch (err) {
 const code = parseErrorCode(err.message);
 // e.g. "CLOUDFLARE_API:RATE_LIMITED"
 switch (code) {
 case 'MISSING_CREDENTIAL': ...
 case 'CLOUDFLARE_API:RATE_LIMITED': ...
 }
}

The full top-level code list is in index.d.ts (CloudpipeErrorCode); the CLOUDFLARE_API sub-kind catalog is CloudflareApiKind.

License

MIT — same as the parent project.