flashmon
v1.0.0
Published
Smart, faster and dependency-aware file watcher for JavaScript and TypeScript.
Maintainers
Readme
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 flashmonOr use it directly with npx:
npx flashmon index.jsUsage
Simply point flashmon to your entry file:
flashmon server.jsTypeScript Support
flashmon works seamlessly with TypeScript projects:
flashmon src/index.tsHow it works
- Parse: flashmon uses SWC to parse your entry file.
- Graph: It recursively finds all
importandrequirestatements to build a dependency graph. - Watch: It uses
chokidarto watch ONLY the files in that graph. - 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
