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

gitdup

v0.1.0

Published

A simple CLI utility. Prints hello world for now.

Readme

gitdup

Duplicate your current project directory, reset tracked git changes, and optionally checkout a branch or PR — while keeping local config like .env.

Great for spinning up parallel workspaces for coding agents such as Codex CLI, so they can branch off a clean copy without losing environment files.

Install

Install globally from npm:

npm i -g gitdup

Or from source (if working locally):

# inside the repo
npm i -g .
# or
npm link

Usage

# Duplicate to a sibling folder (<cwd>-dup or -dup-N)
gitdup

# Specify destination (must not exist or must be empty)
gitdup ../my-project-dup

# Checkout a branch in the duplicate
gitdup -b feature/some-branch

# Fetch and checkout a GitHub PR (default remote: origin)
gitdup -p 123
gitdup -p 123 -r upstream

# Also remove untracked files (keeps ignored like .env)
gitdup --clean

# Verbose git output
gitdup -v

# Node projects: skip copying node_modules and auto-install deps
gitdup

# Disable install step if desired
gitdup --no-install

Behavior:

  • Copies the entire directory (including .git and dotfiles) to preserve local config like .env.
  • Resets tracked changes with git reset --hard. Untracked files are preserved unless --clean is passed.
  • PR checkout uses GitHub-style refspecs (pull/<n>/head).
  • If a destination is provided, it must not exist or must be an empty directory.
  • Node optimization: If a package.json is present, node_modules folders are not copied. After copying, it auto-detects your package manager (npm, pnpm, yarn, bun) and runs install in the duplicate. Use --no-install to skip.

Requirements:

  • Node.js >= 18
  • Git installed and available on PATH
  • Optional: npm/pnpm/yarn/bun installed if you want auto-install for Node projects

Development

Setup:

npm install

Build TypeScript → dist/:

npm run build

Run the CLI (built):

npm start
# or
node dist/cli.js

Link globally for testing:

npm link
gitdup

Scripts:

  • build: Compile TypeScript to dist/.
  • build:watch: Rebuild on changes.
  • start: Run the built CLI.
  • test: Run unit tests once (no watch).
  • test:watch: Run unit tests in watch mode.
  • lint: Lint with ESLint (auto-fix).
  • lint:check: Lint without fixing.
  • format: Auto-format with Prettier.
  • check: Run Prettier check + ESLint (used on pre-push/publish).
  • Pre-push: Husky runs npm run check and npm test before pushing.

Linting notes:

  • Unused imports are auto-removed via eslint-plugin-unused-imports when running with --fix (used in npm run lint).
  • For intentionally unused variables or parameters, prefix them with _ (config ignores ^_).

Publishing (manual):

# build runs via the prepare script during publish
npm publish

Project structure:

  • src/cli.ts: CLI entry (compiled to dist/cli.js).
  • src/index.ts: Implementation (copy + git operations).
  • dist/: Compiled JS and type declarations.
  • test/: Vitest unit tests.
  • tsconfig.json: TS compiler config.
  • .eslintrc.cjs: ESLint config.
  • .prettierrc.json: Prettier config.