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

worktree-plus

v1.1.1

Published

Create git worktrees that actually run - hydrates gitignored paths (node_modules, .env, build caches) from .wt-copy / .wt-symlink manifests.

Readme

worktree-plus

Git worktrees that actually run.

git worktree add checks out tracked files only. So a fresh worktree has no node_modules, no .env, no build caches — it looks correct and does not run. wtp creates the worktree and then hydrates it from two manifests you control.

wtp new fix-login            # create .worktrees/fix-login + hydrate it
cd .worktrees/fix-login      # ready to run
wtp ls                       # what exists
wtp rm fix-login             # refuses if you have uncommitted work

Install

npm i -g worktree-plus            # gives you `wtp`
npx -y worktree-plus new fix-login  # or don't install it at all

Requires Node >= 24.15 and git >= 2.31. No runtime dependencies.

The manifests

Two gitignore-style files — one path per line, # comments and blank lines ignored:

| File | Effect | Use for | |---|---|---| | .wt-copy | cp -R into the worktree | .env files, anything the worktree may modify | | .wt-symlink | ln -s into the worktree | heavy dirs the worktree only reads |

# .wt-copy
.env
apps/api/.env
packages/database/.env

Every entry is relative and resolves against the target repo — one apps/api/.env line serves every checkout of that repo. Nothing is implicit: a .env travels only if a manifest names it.

⚠️ A .wt-symlink entry points at the origin repo's real directory, so a write in the worktree lands in the origin. node_modules is only safe there while the branch does not change dependencies — a pnpm install in the worktree mutates the origin's tree in place.

Where they are read from

By default both tiers are read and unioned, repo last:

  1. ~/.config/wtp/.wt-copy · ~/.config/wtp/.wt-symlink — your cross-repo defaults
  2. <target repo>/.wt-copy · <target repo>/.wt-symlink — committed, per-repo

--manifest-root <dir> (or $WTP_MANIFEST_ROOT) replaces discovery with that one directory: either you named the source or the tool found it, never a blend. wtp ls prints which tiers were used.

Commands

| Command | Does | |---|---| | wtp new <name> [--from <ref>] | git worktree add -b <name> .worktrees/<name>, gitignore .worktrees/, hydrate | | wtp hydrate [path] | re-hydrate an existing worktree — after a dependency install, or one another tool created | | wtp ls | the worktrees wtp manages; ! marks one whose directory is gone | | wtp rm <name> [--force] | remove one and the branch it created, refusing if anything outside the manifest is uncommitted | | wtp prune | git worktree prune | | wtp doctor [path] [--depth n] | scan for symlink loops and invalid nested node_modules | | wtp <cmd> --repo <path> | run new/ls/rm/prune/doctor against another repo | | wtp ls --family | list worktrees across every repo beside this one (read-only) |

--json prints the result as JSON on stdout; every warning and diagnostic goes to stderr, so piping into jq is always safe.

Exit codes: 0 ok · 1 the operation failed · 2 usage or invalid name · 3 doctor found something (gate CI on this).

Working across repos

wtp normally acts on the repo you are standing in. Two flags widen that.

--repo <path> points a command at another repo — useful when a script or an agent runs from one place but the worktree belongs somewhere else:

wtp new fix-login --repo ../api      # created and hydrated over there
wtp ls --repo ../api
wtp rm fix-login --repo ../api

--family surveys every repo sitting beside this one, so you can see everything at once:

$ wtp ls --family
api
   fix-login	fix-login	/home/me/dev/api/.worktrees/fix-login
web
  (none)

Discovery is the filesystem, not a config file: one level up, every directory with a .git. --family-root <dir> (or $WTP_FAMILY_ROOT) surveys somewhere else instead. It is read-only — ls and doctor accept it, new and rm do not, because a command that mutates one repo cannot be pointed at twenty. wtp doctor --family still exits 3 if any repo has a finding, which makes it usable as a one-line CI gate for a whole workspace.

Use it from an AI agent

skill/SKILL.md is a ready-made agent skill — a thin wrapper that teaches an agent the six commands, the exit codes, and the one dangerous manifest choice. Drop it in wherever your harness looks for skills:

# Claude Code
mkdir -p ~/.claude/skills/worktree-plus
curl -o ~/.claude/skills/worktree-plus/SKILL.md \
  https://raw.githubusercontent.com/kuzco77/worktree-plus/main/skill/SKILL.md

Or, if you installed the package, copy it out of node_modules/worktree-plus/skill/. The skill shells out to the same wtp you use by hand, so an agent and a human can never drift onto different behavior.

Library use

const { create, hydrateWorktree, ls, rm, doctor } = require("worktree-plus");
const out = create("fix-login", { cwd: "/path/to/repo" });

Every function takes an injectable run(cmd, args) -> { status, stdout, stderr } and returns a plain JSON-serializable object — the same shape the CLI prints under --json.

Why doctor exists

If a node_modules symlink ends up pointing into itself, pnpm reports [ELOOP] too many symbolic links encountered and names a package — never the link or the worktree that caused it. wtp doctor finds the link. Hydration itself refuses to create one: any entry whose destination parent resolves outside the worktree is skipped before any mkdir, rm or ln runs, because writing through an escaped parent would corrupt the origin repo.

Development

npm test        # node --test test/*.test.js

Filesystem and git mutations go through the injected run seam so unit tests never touch disk; test/e2e.test.js then drives real git and a real filesystem to prove the argv works.

License

MIT