Linux command
nodemon 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Watch and restart Node app
nodemon [app.js]
Watch specific extensions
nodemon -e [js,json] [app.js]
Watch specific directory
nodemon --watch [src/] [app.js]
Ignore files
nodemon --ignore [test/] [app.js]
Execute with different runtime
nodemon --exec [ts-node] [app.ts]
Delay restart
nodemon --delay [2] [app.js]
Use config file
nodemon --config [nodemon.json]
说明
nodemon automatically restarts Node.js applications. Watches for file changes. The tool aids development. Restarts on save without manual intervention.
参数
- -e _EXT_
- File extensions to watch.
- --watch _DIR_
- Directories to watch.
- --ignore _PATTERN_
- Patterns to ignore.
- --exec _CMD_
- Execution command.
- --delay _SECS_
- Restart delay.
- --help
- Display help information.
FAQ
What is the nodemon command used for?
nodemon automatically restarts Node.js applications. Watches for file changes. The tool aids development. Restarts on save without manual intervention.
How do I run a basic nodemon example?
Run `nodemon [app.js]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -e _EXT_ do in nodemon?
File extensions to watch.