nodemon is a CLI tool and library that monitors a directory for file changes and automatically restarts a specified command (typically a Node.js application). It parses command-line arguments and configuration files (nodemon.json, package.json) to determine watch paths, ignore patterns, file extensions, and the command to execute. It uses chokidar for file system watching and manages child processes via fork or spawn. When changes are detected, it matches the changed files against configured rules and restarts the child process if appropriate. It supports custom signals, delay, legacy polling, and event hooks. The architecture is monolithic with a library API, key modules include CLI parser, config loader, rule engine, file watcher, and process manager. The codebase relies on non-standard Node.js APIs (e.g., process.stdin.setEncoding, child_process.fork, process.versions.node), indicating significant technical drift from standard Node.js, though the tool remains widely used and actively maintained.