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

@0xanand/coremap

v0.1.2

Published

Pack a repo into one AI-friendly file — or pass --task to keep only the lines that matter, with a verification receipt.

Readme

CoreMap

Pack your repository into one AI-friendly file — or pass a task and keep only the lines that matter.

npx @0xanand/coremap .

Writes coremap.md: directory tree, source files, and a short summary. Secrets are excluded.

npm Node.js License: MIT


Two modes

| Mode | Command | Output | |------|---------|--------| | Pack | coremap . | Full repo → one file (coremap.md) | | Task | coremap . --task "fix …" | Exact spans → coremap-context.md + coremap-receipt.json |

Pack is the everyday path. Task mode selects a small evidence set and can verify it by applying a patch and running your tests.


Install

No install (recommended):

npx @0xanand/coremap .

Global:

npm install -g @0xanand/coremap
coremap .

Requires Node.js 20+.


Usage

Pack mode

coremap .                          # → coremap.md
coremap . --out-file context.md    # custom name
coremap . --max-tokens 200000      # raise whole-file budget
coremap . --out-dir ./out          # write elsewhere

Task mode

coremap . --task "fix the tax bug" --budget-lines 25

# Optional: prove the context was enough
coremap . --task "fix the tax bug" --verify
coremap . --task "…" --verify --no-llm   # offline (no API key)

Pinned demo (included in this repo):

npm run demo

Example output:

                          Full  Compress   CoreMap
--------------------  --------  --------  --------
Context tokens             432        81       192
HitFile                      —         —      1.00
HitRegion≈                   —         —      0.71
Patch produced              no        no       yes
Tests (original repo)        no        no       yes

coremap: GREEN DELTA  tokens 432→192  |  HitFile=1.00  |  HitRegion≈0.71  |  tests=PASS

Tests (original repo) is the same baseline for the Full and Compress columns; CoreMap applies the demo oracle patch only in an isolated temporary copy.


Features

  • One command — pack a repo in seconds
  • Git-aware — respects .gitignore and optional .coremapignore
  • Secret-safe — path + content filters (keys, tokens, PEMs, etc.)
  • Real token counts — js-tiktoken o200k_base
  • Exact spans — path + line ranges with real source (task mode)
  • Verification receipt — optional patch + tests (--verify)
  • Works offline — pack and selection need no API key

CLI reference

Usage: coremap [options] [path]

Arguments:
  path                        repository path (default: ".")

Options:
  --task <text>               issue / change request (enables task mode)
  --budget-lines <n>          max source lines in the context pack (default: 200)
  --verify                    run one patch attempt + tests
  --no-llm                    offline selection; skip LLM patch
  --ground-truth <patch>      unified diff for HitFile / HitRegion scoring only
  --max-tokens <n>            pack mode whole-file token budget (default: 50000)
  --out-file <name>           pack mode output filename (default: coremap.md)
  --out-dir <dir>             output directory (default: .)
  -V, --version               output version number
  -h, --help                  display help

| Flag | Mode | Notes | |------|------|--------| | --task | task | Turns on span selection + receipt | | --budget-lines | task | Hard line budget for selected source | | --verify | task | Patch attempt + test run | | --no-llm | task | Never call OpenAI; use oracle if --ground-truth is set | | --ground-truth | task | Eval only — never used as selection input | | --max-tokens | pack | Skip huge files once the budget is hit | | --out-file / --out-dir | both | Control where artifacts land |


How it works

Pack: walk the tree (gitignore-aware) → filter secrets → emit tree + files + summary with token counts.

Task: parse the task → gather candidates (terms, symbols, imports, tests) → rank → select exact spans under the line budget → write pack + receipt → optionally verify.

CoreMap architecture


Project layout

src/
  cli.ts              # CLI entry
  index.ts            # library exports
  coremap/            # pack, select, receipt, verify, …
bin/coremap           # npm bin wrapper (optional; published bin is dist/cli.js)
fixtures/             # mini-repo + tax-bug eval fixture
evals/tax-bug/        # issue text + ground-truth patch
specs/coremap/        # product spec / plan / tasks
tests/                # vitest

Development

git clone https://github.com/Anand-0037/coremap.git
cd coremap
npm install
npm test          # 22 tests
npm run build
npm run lint
npm run pack      # dogfood: pack this repo → repomap.txt
npm run demo      # GREEN DELTA on the pinned eval

Scripts

| Script | Purpose | |--------|---------| | npm test | Run vitest | | npm run build | Compile TypeScript → dist/ | | npm run coremap | Run CLI via tsx | | npm run pack | Full pack of this repo | | npm run demo | Pinned task + verify demo |

Ignore rules

CoreMap respects .gitignore. Add a .coremapignore (gitignore syntax) for extra exclusions.


Security

  • Path patterns: .env*, keys, PEMs, credential filenames, and similar
  • Content scan: private-key headers, sk-…, AKIA…, high-entropy secret-like assignments
  • Matched files are skipped; secret contents are never written into the pack

Report security issues via GitHub Issues (or privately if you prefer).


Contributing

  1. Fork and create a branch
  2. Keep changes small and typed (strict TypeScript)
  3. Add or update a vitest for behavior you change
  4. Run npm test && npm run build before opening a PR

Bug reports and PRs are welcome.


License

MIT


Built for the OpenAI Codex Build Week hackathon (Delhi NCR). See CODEX.md. Agent rules: AGENTS.md.