

Specify the config in the same format as you would for a config file but under nodemonConfig in the package.json file, for example, take the following package.//src/style.css h1 If you want to keep all your package configurations in one place, nodemon supports using package.json for configuration.
#Convert prepros to grunt how to
The above nodemon.json file might be my global config so that I have support for ruby files and processing files, and I can run nodemon demo.pde and nodemon will automatically know how to run the script even though out of the box support for processing scripts.Ī further example of options can be seen in sample-nodemon.md package.json

The specificity is as follows, so that a command line argument will always override the config file settings:Ī config file can take any of the command line arguments as JSON key values, for example: -run" An alternative local configuration file can be specified with the -config option. These are usually named nodemon.json and can be located in the current working directory or in your home directory. Nodemon supports local and global configuration files. Whilst nodemon is running, if you need to manually restart your application, instead of stopping and restart nodemon, you can type rs with a carriage return, and nodemon will restart your process. If your script exits cleanly, nodemon will continue to monitor the directory (or directories) and restart the script if there are any changes. Nodemon was originally written to restart hanging processes such as web servers, but now supports apps that cleanly exit. Nodemon will also search for the scripts.start property in package.json (as of nodemon 1.1.x).Īlso check out the FAQ or issues for nodemon. If you have a package.json file for your app, you can omit the main script entirely and nodemon will read the package.json for the main property and use that value as the app ( ref). You can also pass the inspect flag to node through the command line as you would normally: nodemon -inspect. server.js localhost 8080Īny output from this script is prefixed with, otherwise all output from your application, errors included, will be echoed out as expected. Using nodemon is simple, if my application accepted a host and port as the arguments, I would start it as so: nodemon. Nodemon wraps your application, so you can pass all the arguments you would normally pass to your app: nodemon įor CLI options, use the -h (or -help) argument: nodemon -h Instead, the local installation of nodemon can be run by calling it from within an npm script (such as npm start) or using npx nodemon.

With a local installation, nodemon will not be available in your system path or you can't use it directly from the command line.
#Convert prepros to grunt install
You can also install nodemon as a development dependency: npm install -save-dev nodemon # or using yarn: yarn add nodemon -D To use nodemon, replace the word node on the command line when executing your script.Įither through cloning with git or by using npm (the recommended way): npm install -g nodemon # or using yarn: yarn global add nodemonĪnd nodemon will be installed globally to your system path. nodemon is a replacement wrapper for node.
#Convert prepros to grunt code
Nodemon does not require any additional changes to your code or method of development. Nodemon is a tool that helps develop Node.js based applications by automatically restarting the node application when file changes in the directory are detected.
