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

catalyx-agent-node

v0.0.1

Published

🧠 Node.js SDK for Catalyx.dev - the world's smartest AI performance engineer for your app.

Readme

catalyx-agent-node

🧠 Node.js SDK for Catalyx.dev β€” the world's smartest AI performance engineer for your stack.

🌐 What is Catalyx?

Catalyx.dev transforms traditional monitoring into context-aware, AI-powered performance engineering.

It connects deeply to your stack β€” from APIs to databases β€” to:

  • πŸ” Diagnose latency and performance bottlenecks

  • 🧠 Suggest contextual, actionable fixes

  • πŸ’¬ Enable a natural-language developer agent for questions like:

    β€œWhy is the /checkout API slow?” β€œHow do I fix this query?”

Soon, Catalyx will also offer safe auto-fix PRs powered by LLMs and static analysis.

πŸ“¦ What is catalyx-agent-node?

catalyx-agent-node is the official Node.js agent SDK for integrating Catalyx telemetry into your apps.

It uses OpenTelemetry under the hood to:

  • Auto-instrument APIs and DB calls
  • Send anonymized, structured telemetry to the Catalyx Gateway (via OTLP exporter)
  • Provide plug-and-play middleware for popular frameworks like Express, Fastify, NestJS

✨ Features

  • ⏱️ Request-level latency tracking (via OpenTelemetry)
  • πŸ“€ Automatic batch trace export to the Catalyx backend
  • 🧩 Plug-and-play middleware for Express (Fastify, NestJS coming soon)
  • πŸ—ƒοΈ Optional DB wrappers for pg, mysql, mongodb, etc.
  • πŸ” Dynamic instrumentation loader β€” only instruments libraries you already use
  • βš™οΈ Configurable service name, environment, and gateway
  • πŸ“¦ Framework-agnostic + zero vendor lock-in

🧠 OpenTelemetry in catalyx-agent-node

Catalyx wraps the OpenTelemetry Node SDK to make setup zero-config while keeping all the power.

| Concept | Role in Catalyx | | -------------------- | ----------------------------------------------------------------------------------- | | Provider | Uses NodeSDK to initialize TracerProvider & MeterProvider with sane defaults | | Instrumentations | Auto-loaded dynamically for HTTP servers, DB clients, etc. No manual install needed | | Processor | Uses BatchSpanProcessor for efficient trace batching | | Exporter | Uses OTLPTraceExporter (HTTP/gRPC) to send to Catalyx Gateway | | Collector | Catalyx Collector (self-hosted or cloud) receives OTLP data and enriches it |

Flow:


πŸš€ Example setup (with Express+Postgres)

npm install catalyx-agent-node
import { startCatalyxTelemetry } from 'catalyx-agent-node';
import { catalyxMiddleware } from 'catalyx-agent-node/express';
import { catalyxWrapper } from 'catalyx-agent-node/postgres';
import {express} 'express';
import {pg} from 'pg';

await startCatalyxTelemetry({
    service: process.env.CATALYX_SERVICE_NAME || 'my-api',
    env: process.env.CATALYX_ENV || 'development',
    gatewayUrl: process.env.CATALYX_GATEWAY_URL,
    debug: true,
    database: {
      slowQueryThresholdMs: 50, // Low threshold for easy testing
      enableN1Detection: true,
      n1ThresholdCount: 3, // Detect after 3 similar queries
      postgres: {
        captureExplainPlans: true,
      },
    },
    framework: {
      slowRequestThresholdMs: 200, // Low threshold for easy testing
    },
  });
  
const pool = new pg.Pool();
const db = catalyxWrapper(pool);

const app = express();
const PORT = process.env.PORT || 3000;
app.use(catalyxMiddleware());

🧠 Telemetry Payload (Example)

The agent emits OpenTelemetry traces β€” Catalyx enriches them before analysis:

{
  "service": "user-service",
  "env": "production",
  "language": "nodejs",
  "framework": "express",
  "route": "/checkout",
  "method": "GET",
  "status_code": 200,
  "latency_ms": 1842,
  "timestamp": "2025-08-06T10:22:13Z",
  "db_queries": [
    {
      "query": "SELECT * FROM orders WHERE user_id = $1",
      "duration_ms": 750,
      "rows_returned": 500
    }
  ]
}

πŸ”§ Configuration Options

| Option | Type | Description | | ------------ | --------- | --------------------------------- | | service | string | Your microservice name | | env | string | Environment (e.g., dev, prod) | | gatewayUrl | string | Catalyx ingestion endpoint (OTLP) | | debug | boolean | Enable verbose logging |


🧰 Supported Adapters

| Framework | Status | Module | | --------- | -------- | ----------------------- | | Express | βœ… Ready | express/middleware.ts | | Fastify | πŸ› οΈ Soon | fastify/plugin.ts | | NestJS | πŸ› οΈ Soon | nestjs/interceptor.ts | | Koa | πŸ”œ | | | Hapi | πŸ”œ | |


πŸ—ƒ Supported DB Instrumentation

| DB Library | Status | Notes | | ---------- | -------- | ------------------------------ | | pg | βœ… Ready | Auto-wrapped using OTel hooks | | Prisma | πŸ› οΈ Soon | Requires custom client tracing | | MongoDB | πŸ”œ | Planned | | MySQL | πŸ”œ | Planned |


🧠 Why OpenTelemetry?

Catalyx uses OpenTelemetry as the universal trace collection layer, enabling:

  • Unified cross-language telemetry
  • Minimal vendor lock-in
  • Easy extensibility
  • Seamless integration with other tools

πŸ§ͺ Example Use Case

Your /checkout route is slow. Catalyx sees:

  • HTTP latency is 1800ms
  • 90% of time spent in a large pg query
  • Suggests index optimization on orders.user_id

You ask the Copilot: "Why is checkout slow?"

It replies: "Query X takes 1.2s and returns 5k rows. Indexing this column would reduce that by ~85%."