Skip to content

Flashmon is a smarter, faster alternative to nodemon — a smart file watcher that only watches what actually matters. Instead of watching every file in your project, Flashmon parses the AST (Abstract Syntax Tree) of your main server file, builds a precise dependency tree, and watches only those files that are truly part of the runtime.

Notifications You must be signed in to change notification settings

Rohit-Bhardwaj10/flashmon

Repository files navigation

flashmon 🚀

flashmon is a smart, dependency-aware file watcher for JavaScript and TypeScript projects. It is designed to be a faster and more efficient alternative to nodemon by only watching the files your application actually uses.

Why flashmon?

Traditional watchers like nodemon watch everything in your directory. flashmon is different:

  • Dependency Tracking: It analyzes your code's AST to build a dependency graph.
  • Selective Watching: It only watches the entry file and its local dependencies.
  • Node Modules Aware: It automatically ignores node_modules, keeping the watcher lean and fast.
  • Built with SWC: Uses super-fast Rust-based parsing for instantaneous dependency analysis.

Installation

Install it globally:

npm install -g flashmon

Usage

Simply point flashmon to your entry file:

npx flashmon server.js

TypeScript Support

flashmon works seamlessly with TypeScript projects:

npx flashmon src/index.ts

How it works

  1. Parse: flashmon uses SWC to parse your entry file.
  2. Graph: It recursively finds all import and require statements to build a dependency graph.
  3. Watch: It uses chokidar to watch ONLY the files in that graph.
  4. Restart: When any of those files change, it kills the current process and restarts it instantly.

Performance

In our benchmarks, flashmon is consistently 30-50% faster than nodemon in detecting changes and restarting, especially in larger projects with many unused files.

License

ISC

Acknowledgements

  • SWC for the ultra-fast parser.
  • chokidar for reliable file watching.

About

Flashmon is a smarter, faster alternative to nodemon — a smart file watcher that only watches what actually matters. Instead of watching every file in your project, Flashmon parses the AST (Abstract Syntax Tree) of your main server file, builds a precise dependency tree, and watches only those files that are truly part of the runtime.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published