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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@presidio-dev/cor-matrix

v0.0.7

Published

A Node.js SDK and CLI to collect, buffer, and report code origin ratios to a remote server and generate report to understand how much AI-generated code survives in your codebase over time.

Readme

Cor-Matrix (Code Origin Ratio) JS SDK & CLI

A Node.js SDK and CLI to collect, buffer, and report code origin ratios to a remote server and generate report to understand how much AI-generated code survives in your codebase over time.


Installation

Install with your preferred package manager:

npm install @presidio-dev/cor-matrix
# or
bun add @presidio-dev/cor-matrix

SDK Usage (Node.js)

Import and initialize the SDK in your app:

import { CorMatrix } from "@presidio-dev/cor-matrix";

const corMatrix = new CorMatrix({
  appName: "my-app",
  appVersion: "1.0.0",
  baseURL: process.env.COR_MATRIX_BASE_URL,
  token: process.env.COR_MATRIX_TOKEN,
  workspaceId: process.env.COR_MATRIX_WORKSPACE_ID,
});

corMatrix.addCodeOriginRecord({
  code: "console.log('Hello');",
  path: "index.ts",
  language: "typescript",
  timestamp: Date.now(),
});

// Add more code origin records as needed...

// Manually flush (optional)
await corMatrix.flush();

Configuration Options

  • appName (string, required): Name of your application
  • appVersion (string, required): Version of your app
  • baseURL (string, required): API server URL
  • token (string, required): API authentication token
  • workspaceId (string, required): Workspace identifier
  • batchSize (number, optional): Code origin records per batch (default: 20)
  • flushIntervalMs (number, optional): Auto-flush interval ms (default: 5000)
  • maxQueueSize (number, optional): Max buffered code origin records (default: 1000)
  • logLevel ("error"|"warn"|"info"|"debug", optional): Logging (default: "error")
  • maxRetries (number, optional): Max flush retries (default: 3)

CLI Usage

The CLI provides a report command to analyze your codebase and compare it with AI-generated code tracked in your workspace.

Run with npx (recommended)

npx @presidio-dev/cor-matrix report \
  --workspace-id <id> \
  --project-path <path> \
  --api-url <url> \
  --api-token <token>

CLI Options

  • --workspace-id (or env: COR_MATRIX_WORKSPACE_ID): Workspace ID
  • --project-path (or env: COR_MATRIX_PROJECT_PATH): Path to your codebase
  • --api-url (or env: COR_MATRIX_BASE_URL): API server URL
  • --api-token (or env: COR_MATRIX_TOKEN): API token

All flags can be set via environment variables for convenience.

Example

export COR_MATRIX_WORKSPACE_ID=abc123
export COR_MATRIX_PROJECT_PATH=~/projects/my-app
export COR_MATRIX_BASE_URL=https://api.cor-matrix.dev
export COR_MATRIX_TOKEN=your_token
npx @presidio-dev/cor-matrix report

Output

The CLI will output a report with the following sections:

ℹ Starting report generation...
ℹ Fetching code origin signatures...
✔ Remote signatures fetched.
ℹ Analyzing local files in /path/to/your/project...
✔ Local files analyzed.

 COR-Matrix Report
────────────────────────────────────────────────────────────────
Codebase Path:                  /path/to/your/project
Report Time:                    June 1, 2025 at 6:00 PM
Total Lines:                    961 (100%)
AI-Written Lines:               40 of 961 (4.16%)
────────────────────────────────────────────────────────────────