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

@polymerix-labs/facts-extract

v0.11.0

Published

Analyze a project directory and output structured JSON describing its source files (symbols, imports, and code references). Installs the native CLI for your OS.

Readme

@polymerix-labs/facts-extract

Analyze a project directory and write a FactsBundle JSON file — one entry per supported source file.

The native CLI for your platform is installed automatically (same pattern as esbuild); nothing is downloaded at runtime.

Install

npm install @polymerix-labs/facts-extract

Supported platforms

| OS | Arch | Package | |----|------|---------| | Linux | x64 | @polymerix-labs/facts-extract-linux-x64 | | Linux | arm64 | @polymerix-labs/facts-extract-linux-arm64 | | macOS | x64 (Intel) | @polymerix-labs/facts-extract-darwin-x64 | | macOS | arm64 (Apple Silicon) | @polymerix-labs/facts-extract-darwin-arm64 | | Windows | x64 | @polymerix-labs/facts-extract-win32-x64 |

Usage

Resolve the binary path (spawn it yourself)

const { binaryPath } = require("@polymerix-labs/facts-extract");
const { spawnSync } = require("child_process");

const out = spawnSync(binaryPath, ["--repo-root", "/abs/path/to/project"], {
  encoding: "utf8",
});
const bundle = JSON.parse(out.stdout); // FactsBundle

Run as a CLI

npx @polymerix-labs/facts-extract --repo-root /abs/path/to/project -o bundle.json

Flags

| Flag | Effet | |------|-------| | --repo-root <PATH> | Absolute path to the repository root (required) | | --output, -o <FILE> | Write the FactsBundle JSON to a file (default: stdout) | | --verbose | Real-time logs on stderr | | --progress | Progress bar on stderr during the parallel parse pass |

Exit codes: 0 success, 1 usage error, 2 repo not found, 3 extraction/serialize error.

Output

The CLI writes a FactsBundle JSON (schema_version, repo_root, and a files array). Each file entry includes:

| Field | What it contains | |-------|------------------| | entry | File path, language, extension | | facts.imports | Import declarations as written in source | | facts.exports | Export / re-export declarations (JS/TS) | | facts.symbols | Classes, methods, functions, fields… with names, types, signatures, and source positions | | facts.refs | Calls, type uses, inheritance, annotations — collected as written, not yet resolved to targets | | facts.local_bindings | Local variables and their declared or inferred types | | facts.has_syntax_errors | Whether the file had parse errors |

The bundle format is versioned by FACTS_SCHEMA_VERSION (currently 1).