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

cfcontrail

v0.1.1

Published

Trace what's wrong with your Cloudflare Workers and Pages

Downloads

26

Readme

cfcontrail

Trace what's wrong with your Cloudflare Workers and Pages.

Three modes:

  1. list -- discover all Workers/Pages with recent activity
  2. scan -- scan for error spikes, latency anomalies, status distributions
  3. logs -- pull detailed per-request logs from Workers Observability

Install

npx cfcontrail

Or install globally:

npm install -g cfcontrail
cfcontrail

Usage

# List all projects with recent activity
cfcontrail list

# Scan all workers for the last hour (default)
cfcontrail scan

# Scan a specific project over 6 hours
cfcontrail scan --project myteam-www --period 6h

# Focus on errors only
cfcontrail scan --errors --period 24h

# Pull detailed per-request logs
cfcontrail logs --project footyapps

# Logs from a specific time
cfcontrail logs --project footyapps --since "2026-03-31T10:00:00Z"

Environment variables

Create a .env file in the directory you run the command from, or export these:

| Variable | Required | Description | |---|---|---| | CLOUDFLARE_ACCOUNT_ID | Yes | Your Cloudflare account ID | | CLOUDFLARE_API_TOKEN | Yes* | Bearer token (preferred auth method) | | CLOUDFLARE_EMAIL | Yes* | Email for Global API Key auth | | CLOUDFLARE_API_KEY | Yes* | Global API Key | | CLOUDFLARE_LOGS_API_KEY | No | Separate token scoped for telemetry API |

*Either CLOUDFLARE_API_TOKEN or both CLOUDFLARE_EMAIL + CLOUDFLARE_API_KEY are required.

Flags

| Flag | Default | Description | |---|---|---| | --period <1h\|6h\|24h\|7d\|30d> | 1h | Time window | | --project <name> | | Filter to a Pages project | | --script <name> | | Filter to a Worker script name | | --errors | | Show error timeline (scan mode) | | --since <ISO> | | Start time for logs | | --limit <n> | 50 | Max events to fetch (logs mode) |

Prerequisites for logs mode

Workers must have observability enabled:

# wrangler.toml
[observability]
enabled = true

Contrail checks for this automatically and offers to add it if missing.

Security

Use scoped API tokens, not Global API Keys. A scoped token with Account Analytics:Read and Workers Scripts:Read is all cfcontrail needs. Global API Keys (CLOUDFLARE_API_KEY) grant full account access and should be a last resort.

Don't commit .env files. If you use cfcontrail in CI, pass credentials via environment variables rather than .env files in the repo.

Output may contain sensitive data. The logs mode prints request URLs, exception messages, and console output from your workers. These can contain query parameters, session tokens, or PII. Don't pipe output to shared logs or issue trackers without review.

Input validation. Project and script names are validated against a strict allowlist ([a-zA-Z0-9_\-\.]) to prevent injection into API queries. --limit is capped at 1000.

How it works

  • list and scan use the Cloudflare GraphQL Analytics API (workersInvocationsAdaptive) -- works on all plans, no setup needed
  • logs uses the Workers Observability Telemetry API -- requires [observability] enabled = true and a redeploy

License

MIT