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

wappler-cleanup-tool

v1.0.0

Published

Interactive CLI tool to identify and cleanup unused resources in Wappler projects

Readme

Wappler Project Cleanup Tool

Interactive CLI tool to identify and safely cleanup unused resources in your Wappler projects.

Features

  • 🔍 Smart Detection: Finds unused server actions in /app/api/ and /app/lib/
  • 🛣️ Dead Routes Detection: Finds routes in routes.json that reference missing files
  • 🎯 Multi-Pattern Scanning: Detects references in HTML, EJS, JSON, and JavaScript files
  • 🔗 Queue-Aware: Identifies Bull queue api_file references (critical for background jobs)
  • 📁 Empty Folder Cleanup: Detects and removes empty directories
  • 🎮 Interactive by Default: User-friendly interface for safe cleanup
  • 📊 Confidence Levels: Safe-to-delete vs review-needed scoring
  • 💾 Backup System: Automatic backup before deletion
  • 📈 Detailed Reports: Export results to JSON or HTML

Installation

Global Installation (Recommended)

npm install -g wappler-cleanup-tool

One-time Usage (No Installation)

npx wappler-cleanup-tool

Usage

Interactive Mode (Default)

cd /path/to/your/wappler/project
wappler-cleanup

Non-Interactive Mode

# Just show results
wappler-cleanup --non-interactive

# Export to JSON
wappler-cleanup --non-interactive --output results.json

# Specify project directory
wappler-cleanup --project-root /path/to/wappler/project

How It Works

1. Discovery Phase

  • Server Actions: Scans /app/api/**/*.json and /app/lib/**/*.json for files with exec or steps
  • Dead Routes: Scans app/config/routes.json for routes pointing to missing files
  • Empty Folders: Detects directories that can be safely removed

2. Reference Detection

The tool looks for these patterns:

HTML/EJS Files:

  • url="/api/v1/courses/create"
  • action="/api/v1/security/login"

JSON Files (Critical for Queues):

  • "api_file": "/app/api/v1/queues/integrations/mailerlite/sync/..."
  • "exec": "lib/security/check"
  • "module": "core"

JavaScript Files:

  • fetch('/api/v1/courses')
  • url: '/api/v1/users'

3. Confidence Scoring

  • Safe to Delete: No references found - likely safe to delete
  • Review Needed: References found - manual review required

4. Interactive Features

  • 📋 View all actions with status indicators
  • 🔍 Detailed view with references and file content
  • ☑️ Multi-select actions for deletion
  • 🗂️ Empty folder detection and cleanup
  • 🚨 Confirmation prompts with backup options
  • 💾 Export results for team review

Safety Features

  • Dry Run Default: Shows what would be deleted without actually deleting
  • Backup System: Creates timestamped backups before deletion
  • Confidence Levels: Clear indicators of deletion safety
  • Interactive Confirmation: Multiple confirmation steps for deletion
  • Detailed Logging: See exactly what references were found

Example Output

📊 Scan Results Summary

✅ Used actions: 180
⚠️  Review needed: 45  
🗑️ Safe to delete: 20
🛣️ Dead routes: 8
📁 Empty folders: 5
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Total items: 258

What Would You Like to Do?

  • 🗑️ View safe to delete items (25)
  • 📋 View all actions (245)
  • ☑️ Select items for deletion (0 selected)
  • 💾 Export results to JSON
  • 👋 Exit

Use Cases

  • Project Maintenance: Keep your Wappler project clean and organized
  • Performance: Remove unused code that might affect build times or deployment size

Edge Cases Handled

  • Queue Jobs: Detects api_file references in Bull queue definitions
  • Dynamic References: Identifies computed API paths in JavaScript
  • Library Actions: Finds lib/ references in exec statements
  • Webhook Actions: Scans webhook handlers for API calls
  • Schedule Jobs: Checks cron job definitions
  • Nested Empty Folders: Recursively finds and handles empty directory trees

Configuration

Create an ignore-list.json file in your project root to exclude specific paths:

{
  "ignored": [
    "/api/dev-test",
    "/api/template-*",
    "lib/shared/utilities"
  ]
}

Warning

Always review results carefully before deletion. The tool is designed to be safe, but:

  • Some actions might be referenced dynamically in ways not detectable by static analysis
  • Environment-specific actions might be needed in production but not development
  • Create backups and test thoroughly after cleanup

Contributing

Pull requests welcome! This is a community tool - feel free to improve it.

License

MIT - see LICENSE file for details.