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

@mesrai/mesrai-graph

v0.1.0

Published

Code graph builder for Mesrai code review — parses source code into structural graphs with nodes, edges, and analysis

Readme

@mesrai/mesrai-graph

Internal code-graph builder for the Mesrai AI code review platform.

Turns a source tree into a structural graph (functions, classes, calls, imports, inheritance, tests) so the Mesrai review agent can reason about pull requests with real cross-file context — what a change touches, what depends on it, and where the tests live.

Distributed as a Bun-based CLI + Node-importable library. Runs inside Mesrai CI pipelines and ephemeral E2B sandboxes during each PR review.

Internal tool — proprietary. Not accepting external contributions or issues. See LICENSE.


Install

bun install -g @mesrai/mesrai-graph

Requires Bun ≥ 1.3.0.

mesrai-graph --version

Usage

# Step 1 — build a baseline graph for the repo
mesrai-graph parse --all --repo-dir . --out graph.json

# Step 2 — get review context for the files in a PR
mesrai-graph context \
  --files src/billing/charge.ts src/billing/refund.ts \
  --graph graph.json \
  --format prompt \
  --out -

The prompt format is plain text appended to the LLM system prompt. The json format is structured for programmatic consumption inside the Mesrai agent loop.


Capabilities

| Capability | Notes | |---|---| | 15-language extraction | TS/JS, Python, Go, Java, Kotlin, Rust, C/C++, C#, PHP, Ruby, Scala, Swift, Dart, Elixir | | 5-tier call resolver | receiver → di → class → cascade — every CALLS edge carries tier + numeric confidence | | Receiver-type inference | Resolves foo.bar() from constructor results, typed params, factory returns, singletons | | DI awareness | Spring (@Autowired/implicit ctor), Jakarta CDI, EJB, JAX-RS, NestJS, Kotlin/Java field injection | | Inheritance walk | Walks class hierarchy with cycle protection when Foo.method is inherited | | Contract diffs | Detects param/return/modifier/async/decorator changes — not just body edits | | Incremental updates | update re-parses only changed files (content-hash based) | | Streaming JSON output | Handles million-node monorepos without exhausting memory | | Pipe-friendly | --out - writes JSON to stdout; logs to stderr |

Per-language capability tiers: docs/language-support-matrix.md.


Commands

| Command | Purpose | |---|---| | parse | Build a graph from source files | | update | Re-parse only changed files, merge into existing graph | | analyze | Compute blast-radius / risk per function for changed files | | context | Produce per-file review context (JSON or prompt format) | | diff | Compare graphs across two refs to surface contract changes | | communities | Cluster modules by coupling — find boundary lines | | flows | Trace execution paths across function calls | | search | Query the graph by name, kind, caller, or callee |

Run any command with --help for the full flag list.


Library usage

import { parseGraph, getContext } from "@mesrai/mesrai-graph";

const graph = await parseGraph({ repoDir: "./my-repo", maxMemoryMb: 1024 });
const context = await getContext({
    graph,
    files: ["src/auth/login.ts"],
    format: "json",
});

Type definitions ship with the package.


Graph shape (short)

Nodes carry name, kind (function/method/class/interface/enum/test), file, line range, plus is_exported, is_async, decorators, throws, complexity.

Edge types:

  • CALLS — function-to-function (with tier + confidence)
  • IMPORTS — file-to-file
  • INHERITS / IMPLEMENTS — class hierarchy
  • TESTED_BY — code → test
  • CONTAINS — class → method / file → class

Full schema: docs/SCHEMA.md.


License

Proprietary — Mesrai Technologies. See LICENSE.