Flash ⚡
An impossibly fast file watcher that executes commands when files change.
1.8ms startup time • 8.9MB memory usage • 19.7x faster than Nodemon
Think nodemon, but more general purpose and written in Rust.
Features
- ⚡ Blazingly fast - 1.8ms startup, 19.7x faster than Nodemon (benchmarks)
- 🎯 Flexible filtering - Support for glob patterns, file extensions, and ignore patterns
- 🔧 Configurable - YAML configuration files for complex setups
- 📊 Performance monitoring - Built-in statistics and benchmarking
- 🔄 Process management - Restart long-running processes or spawn new ones
- 🌍 Cross-platform - Works on Windows, macOS, and Linux
- 🎨 Beautiful output - Colored terminal output with clear status messages
- 💾 Memory efficient - Only 8.9MB memory usage, single 1.8MB binary
Installation
From Crates.io (Recommended)
From Source
Pre-built Binaries
Download pre-built binaries from the releases page.
Usage
Arguments
<COMMAND>...: Command to run when files change
Options
-w, --watch <WATCH>: Paths/patterns to watch (supports glob patterns likesrc/**/*.js)-e, --ext <EXT>: File extensions to watch (e.g., "js,jsx,ts,tsx")-p, --pattern <PATTERN>: Specific glob patterns to include (e.g., "src/**/*.{js,ts}")-i, --ignore <IGNORE>: Glob patterns to ignore (e.g., "/node_modules/")-d, --debounce <DEBOUNCE>: Debounce time in milliseconds [default: 100]-r, --restart: Restart long-running processes instead of spawning new ones-c, --clear: Clear console before each command run-n, --initial: Run command on startup-f, --config <CONFIG>: Use configuration from file--stats: Show performance statistics while running--stats-interval <SECONDS>: Statistics update interval in seconds [default: 10]--bench: Run benchmark against other file watchers-h, --help: Print help-V, --version: Print version
Glob Pattern Support
Flash supports powerful glob pattern matching for both watching files and filtering them:
Watch Patterns (-w)
Watch specific file patterns directly:
# Watch all JavaScript files in src directory
# Watch multiple specific patterns
Ignore Patterns (-i)
Ignore specific directories or files:
# Ignore node_modules and dist directories anywhere in the tree
# Ignore minified files
Include Patterns (-p)
Specifically include only certain file patterns:
# Only include TypeScript files in src and test directories
Combining Options
The most powerful usage comes from combining these options:
Examples
Watch current directory and restart a Node.js server when changes occur:
Watch TypeScript files in the src directory and run the build script:
Watch multiple directories but ignore node_modules:
Watch using glob patterns to include only specific files:
Clear console and run command on startup:
Run with performance statistics:
Configuration File
You can define a configuration file in YAML format to avoid typing long commands:
# flash.yaml
command:
watch:
- "src/**" # Watch all files in src directory recursively
- "public/*.html" # Watch HTML files in public directory
ext: "js,jsx,ts,tsx"
pattern:
- "src/**/*.{js,jsx,ts,tsx}" # JavaScript/TypeScript files in src
ignore:
- "**/node_modules/**" # Ignore node_modules directory
- "**/.git/**" # Ignore .git directory
- "**/*.min.js" # Ignore minified JS files
debounce: 200
initial: true
clear: true
restart: true
Then run Flash with:
You can also override configuration file settings with command line arguments.
Common Use Cases
Web Development
Rust Development
Documentation
Performance and Benchmarks
Flash is designed to be blazingly fast and resource efficient. To see how it compares to other file watchers:
This will run a series of benchmarks comparing Flash against popular file watchers like nodemon, watchexec, and cargo-watch.
Performance
Flash is designed for speed. See our performance benchmarks for detailed comparisons with other file watchers.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details on how to get started.
Support
- 📖 Documentation: Check the README and examples
- 🐛 Bug Reports: Open an issue
- 💡 Feature Requests: Open an issue
- 💬 Questions: Start a discussion
License
This project is licensed under the MIT License - see the LICENSE file for details.