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

kanmi-perf-revenue

v1.4.0

Published

Revenue intelligence for web performance — Native Datadog RUM integration or bring your own data via CSV/JSON

Readme

kanmi-perf-revenue

Revenue intelligence for web performance — Native Datadog RUM integration or bring your own data.

No assumed coefficients. No "0.5% CVR per 100ms" guesses. This tool measures the actual conversion rates at each performance bucket from YOUR session data.

Install

npm install kanmi-perf-revenue

Quick Start

CLI

# Demo with mock data
npx kanmi-perf-revenue --demo

# From CSV/JSON file
npx kanmi-perf-revenue --file sessions.csv --client "Acme Corp"

# From Datadog RUM
DD_API_KEY=xxx DD_APP_KEY=xxx npx kanmi-perf-revenue --start 2026-01-01 --end 2026-01-14

Library

import { analyzeFromFile, analyzeWithDatadog } from 'kanmi-perf-revenue';

// From CSV/JSON
const result = analyzeFromFile({
  filePath: './sessions.csv',
  clientName: 'Acme Corp',
});

// From Datadog RUM
const result = await analyzeWithDatadog({
  apiKey: process.env.DD_API_KEY,
  appKey: process.env.DD_APP_KEY,
  startDate: '2026-01-01',
  endDate: '2026-01-14',
});

console.log(result.report);
console.log(`Top opportunity: $${result.topOpportunity?.monthlyRevenue}/month`);

What You Get

Empirical Conversion Curves

Actual CVR measured at each performance bucket:

| LCP Range   | Sessions | CVR    | Revenue |
|-------------|----------|--------|---------|
| 0.0s-1.0s   | 1,852    | 3.67%  | $8K     |
| 1.0s-1.5s   | 12,339   | 2.79%  | $40K    |
| 2.0s-2.5s   | 13,684   | 2.22%  | $37K    |
| 3.0s+       | 420      | 1.40%  | $500    |

Revenue Opportunity

Top Opportunity: LCP
37% of sessions have LCP > 2.5s
These sessions convert 18.5% worse than faster sessions
Monthly revenue opportunity: $10K/month

Data Input

CSV/JSON Format

Required: session_id, converted (or has_purchase)

Optional: lcp_ms, inp_ms, cls, fcp_ms, ttfb_ms, order_value, device, page_type

session_id,lcp_ms,converted,order_value,device
abc123,1200,1,89.99,mobile
def456,3500,0,0,desktop

See docs/data-sources.md for Datadog setup and self-hosted options.

Features

| Feature | Description | |---------|-------------| | 8 Performance Metrics | LCP, FCP, INP, CLS, TTFB, TTI, Onload, Page Size | | Segmentation | Device, page type, geography, traffic source | | Statistical Significance | Confidence intervals, p-values, effect sizes | | ROI Calculator | Engineering effort vs expected revenue gain | | Forecasting | 12-month revenue projections | | A/B Test Integration | Compare performance variants statistically | | Export Formats | JSON, CSV, Slack blocks, HTML email |

See docs/advanced-usage.md for detailed examples.

CLI Reference

kanmi-perf-revenue [options]

Data Sources:
  --file PATH         Import from CSV or JSON file
  --demo              Run with mock data (for testing)
  --api-key KEY       Datadog API key (or set DD_API_KEY)
  --app-key KEY       Datadog App key (or set DD_APP_KEY)

Options:
  --start DATE        Start date (YYYY-MM-DD)
  --end DATE          End date (YYYY-MM-DD)
  --client NAME       Client name for report header
  --save              Save analysis to history
  --compare           Compare to baseline
  --help, -h          Show help

How It Works

  1. Bucket sessions by performance — Group by performance ranges (e.g., 0-1s, 1-2s LCP)
  2. Measure actual CVR per bucket — Calculate conversion rate from your real data
  3. Calculate opportunity — If slow sessions performed like fast ones, how many more conversions?
  4. Prioritize by revenue impact — Rank metrics by potential monthly revenue gain

No industry benchmarks. No assumed coefficients. Just your data.

License

MIT

Author

Kanmi Obasa [email protected]