@ghostbusters/ghostbusters-test-package
v1.0.1
Published
AST-based Git hook to prevent ghost routes
Readme
Ghostbusters 👻
Stop phantom endpoints from haunting your codebase.
Ghostbusters is a lightweight JavaScript utility designed to identify "ghost routes" (unused or broken endpoints) in React-to-Express routing. By integrating directly into your Git workflow, it ensures that dead code is eliminated before it ever hits production.
📇 Features
- ESM Support: Optimized for modern environments using ECMAScript Modules to provide a lightweight and efficient footprint.
- Git Hooks: Leverages Husky to automate code quality checks, catching ghost routes at the point of commit.
- Dedicated CLI: Includes a dedicated entry point for terminal-based route detection.
🔍 How it Works
Ghostbusters analyzes your codebase to identify discrepancies between your frontend API calls and backend routes. It specifically flags:
- Broken Calls: Requests in your frontend that point to routes that don't exist in your backend.
🚦 Getting Started
Prerequisites
- Node.js
- npm
Installation
npm install ghostbusters --save-dev🧼 Usage
To scan your project for ghost routes, execute the utility from your command line:
# Run the ghost route detection suite
npm start🏛️ Project Structure
.husky/: Pre-commit hook configurationssrc/: Core logic & CLI entry pointtest/: Quality control test suitesscripts/: Development automation helperspackage.json: ESM configuration & dependencies
🧪 Testing
We use a dedicated test suite to ensure the detection logic is accurate.
npm test⚖️ License
This project is licensed under the MIT License.
