Wachit
View live website here: wachit.dev
Wachit is a lightweight file watcher tool that helps develop applications by automatically restarting the server when file changes in the directory are detected.
Wachit does not require any additional changes to your code or development process. Wachit is a replacement wrapper for your runtime executable. To use wachit, replace your runtime command on the command line when executing your script.
Installation
Make sure rust is installed on your system. If not you can refer to the rust Installation instructions here:
And wachit will be installed globally to your system path.
Usage
Wachit supports multiple language runtimes including Node.js, Python, Go, and Rust (Cargo).
Using CLI
Navigate to your project directory and run the command in the following format:
wachit [wachit options] [target file name]
wachit options
You can pass multiple options to configure wachit runtime:
--inspect: Enables inspect mode (currently supports Node.js). This will be serialized tonode --inspect [provided-file-name].--exec=<RUNTIME>: Specify the runtime executable. Options:NODE,PYTHON,GOLANG,CARGO. Defaults toNODE.--watch=<extensions>: Comma-separated list of file extensions to watch (e.g.,--watch=.js,.ts,.json).--ignore=<extensions>: Comma-separated list of file extensions to ignore (e.g.,--ignore=.test.js,.spec.ts).
Examples
# Run a Node.js application
# Run a Python application
# Run with Node.js inspect mode
# Watch specific file types
# Ignore specific file types
# Run a Go application
# Run a Rust application
Target File Name
You must provide a target file name. Wachit will use the specified executable (or default to node) to run that file.
Using Config file
If a wachit.json file is present in the current working directory, wachit will prioritize it over any CLI arguments. The configuration file will override all CLI arguments.
Configuration Options
type Config = {
executable: "NODE" | "PYTHON" | "GOLANG" | "CARGO"; // Runtime executable
target: string; // Target filename with path
inspect: boolean; // Whether to enable inspect mode (Node.js only)
watch_list: string[]; // List of file extensions to watch
ignore_list: string[]; // List of file extensions to ignore
delay: number; // Restart delay in milliseconds (default: 2000)
}
Default Behavior
Wachit automatically ignores common directories and files:
node_modules/build/dist/target/(for Rust projects).next/.git/.vscode/.env.gitignorewachit.json
Supported File Extensions by Runtime
- NODE:
.js,.jsx,.ts,.tsx - PYTHON:
.py - GOLANG:
.go - CARGO:
.rs
Contributing
Wachit is not perfect and that is why it needs talented developers like you to contribute.
If you have a feature suggestion or come across a bug please don't hesitate to open a ticket. I have too much free time on my hands to not go through your ideas and suggestions. If you get my approval on any feature or bugfix, you can contribute with the following steps:
- Clone the git repository.
- Create a branch, code something cool.
- Create a pull-request.
That's all.