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

backpedal

v1.1.1

Published

Git-backed command transaction wrapper

Readme

backpedal npm version npm downloads License Node

🚲 backpedal

Database transactions — for your filesystem. Run any command with a safety net. If it fails, your workspace rewinds instantly. If it succeeds, you keep rolling.

Features · Quick Start · CLI · How It Works · vs Competitors


✨ Features

| Feature | What It Does | |:--------|:-------------| | 🔄 Automatic Rollback | Non-zero exit? Ctrl-C? Timeout? Everything rewinds — including untracked files | | 🪶 Zero Dependencies | No npm deps. Just Node.js + Git (or pure Merkle-tree fallback for non-git dirs) | | 📜 Full History | Every transaction logged — roll back to any snapshot by index or commit SHA | | 🤖 CI / Headless Ready | --yes flag or BACKPEDAL_AUTO_ROLLBACK=true skips TTY prompts | | ⏱️ Timeout Protection | --timeout 30000 kills hung commands and rolls back automatically | | 🛡️ Signal-Safe | Ctrl-C (SIGINT) or kill (SIGTERM) triggers rollback before exiting | | 🔀 Hybrid Backend | Prefers Git snapshots (orphaned commits, never touches your index). Falls back to SHA-256 Merkle trees |

[!NOTE] New in 1.1: Signal handling, command timeout, crypto.randomUUID() transaction IDs, private Git index isolation (never pollutes your staging area), and shell-metacharacter-safe commit messages.


🚀 Quick Start

npm install -g backpedal
# Run anything — if it breaks, you're safe
backpedal run "npm run risky-migration"

# CI mode — auto-rollback on failure, no prompts
backpedal run "make deploy" --yes --timeout 60000

📖 CLI Reference

backpedal run <command>

Wrap any shell command in a safety transaction.

backpedal run "npm test"                    # Auto-rollback if tests fail
backpedal run "npx prisma migrate dev" -y   # Skip TTY prompt
backpedal run "sleep 999" --timeout 5000    # Kill + rollback after 5s

backpedal rollback [index|sha]

Rewind to a previous transaction state.

backpedal rollback            # Undo the last transaction
backpedal rollback 1          # Undo to history index [1]
backpedal rollback abc123f    # Undo to specific commit SHA

backpedal history

List all transaction snapshots with timestamps and SHAs.

| Flag | Description | |:-----|:------------| | --yes, -y, --auto-rollback | Auto-rollback on failure (no prompt) | | --timeout <ms> | Kill command + rollback after N milliseconds | | BACKPEDAL_AUTO_ROLLBACK=true | Env var equivalent of --yes |


🔧 How It Works

┌──────────────────────────────────────────────────────┐
│  1. SNAPSHOT                                          │
│  Creates an orphaned Git commit of your entire        │
│  working tree (tracked + untracked files)              │
│  → Private GIT_INDEX_FILE — your staging area is safe │
├──────────────────────────────────────────────────────┤
│  2. EXECUTE                                           │
│  Runs your command with stdio inherited               │
│  → SIGINT/SIGTERM handlers listen for interrupts      │
├──────────────────────────────────────────────────────┤
│  3. EVALUATE                                          │
│  Exit 0 → Keep changes, log transaction               │
│  Exit ≠ 0 → git reset --hard + git clean -fd          │
│  Timeout  → SIGTERM → (5s grace) → SIGKILL → rollback │
│  Signal   → Kill child → rollback → exit              │
└──────────────────────────────────────────────────────┘

[!TIP] Not in a Git repo? backpedal falls back to SHA-256 Merkle-tree snapshots stored in .backpedal-snapshots/. Same API, no Git required.


🆚 Why backpedal?

| Tool | Paradigm | Auto-Rollback | Signal-Safe | Untracked Files | No Git Required | |:-----|:---------|:-------------:|:-----------:|:---------------:|:---------------:| | backpedal | Transaction wrapper | ✅ | ✅ | ✅ | ✅ | | SafeSandbox | Git branch snapshots | ❌ | ❌ | ❌ | ❌ | | SnapBack | Manual snapshots | ❌ | ❌ | ❌ | ✅ | | claude-oops | Claude Code only | ❌ | ❌ | ❌ | ❌ | | undoai | File-watcher daemon | ❌ | ❌ | ✅ | ✅ |

The difference: Every other tool is a snapshot tool — you take a picture, then later decide to restore it. backpedal is a transaction wrapper — you run a command, and the rollback decision is automatic. No separate snapshot step. No manual restore. Just run your command and forget about it.

See the competitive analysis for details.


📄 License

MIT · codecrypt112