{"_id":"@baladins/grunt-nodemon","_rev":"1-53fe943233b139f94ced8631f3535da0","name":"@baladins/grunt-nodemon","dist-tags":{"latest":"0.4.6"},"versions":{"0.4.6":{"name":"@baladins/grunt-nodemon","version":"0.4.6","description":"Grunt task to run a nodemon monitor of your node.js server","main":"test/fixtures/server.js","private":false,"scripts":{"test":"grunt test"},"repository":{"type":"git","url":"git+https://github.com/baladins/grunt-nodemon.git"},"keywords":["gruntplugin","nodemon","server"],"author":{"name":"Chris Wren"},"license":"MIT","peerDependencies":{"grunt":">=0.4.0"},"devDependencies":{"grunt":"^1.4.1","grunt-contrib-jshint":"^3.0.0","grunt-markdownlint":"2.2.1","grunt-release":"^0.13.0","grunt-simple-mocha":"^0.4.0","matchdep":"^2.0.0","should":"^7.1.0"},"dependencies":{"nodemon":"^2.0.9"},"bugs":{"url":"https://github.com/baladins/grunt-nodemon/issues"},"homepage":"https://github.com/baladins/grunt-nodemon#readme","directories":{"test":"test"},"gitHead":"12d3128aff776214e0f1388fcabdf04ac014b309","_id":"@baladins/grunt-nodemon@0.4.6","_nodeVersion":"12.18.3","_npmVersion":"6.14.12","dist":{"integrity":"sha512-rRKWh8p2Ofs9+1xzl9ot0g78xgSn9OZGEWS5AfecPModHe51KzgDqI+ei3b0lUfP5C5B+Si7sXG0EuVneHyc1g==","shasum":"a9cdc0ad09d48c39f76f8b797f6a1c343504b1ca","tarball":"https://registry.npmjs.org/@baladins/grunt-nodemon/-/grunt-nodemon-0.4.6.tgz","fileCount":6,"unpackedSize":13093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5Z8HCRA9TVsSAnZWagAAD3YP/i2Ht3MqUlwdOQOlMq2d\nqoBL6jki71FN2bDi8W1Cqz3enz5CQR/afQ+9nhec0dwfk0OlnJklGR1B1AFK\n54rQxdzDFOzmDZbpsdphRtR9hmAo5ecB28amI5Qb3W5liTFqxbLJ18cnNUgf\nP69PuxyWDWbwwePdSbrAJimGtmFzzIIIoGxkHVMKrGdIcePpcelOuc0rjnge\nXkeUN6s6kTYCO0afVVJK2WZqqfU4Lh5zlTuJzF9aM/sFLHQCyTfzMPOH/cbd\nNO4SYm4SbBwd0EWValSrfcwYIRmhMhZvZ5mimOtn+k7OjOkwFk2WanA4IpnG\nqwNN8PWfpcalg9BMqu07nhaNmAvkBL7/Z5SgewV/+Ffab76pq92BHAl8XtZs\nJRWaXzHI7qZu+/nzRTlpqBhF+dQS3Hvp0aqKUXn2RXjR/XF9v1HRU6k7IpnH\nuQEwcWQp8ZlPHkSXLgVBIKH++G0MyWsF4i1sEgoKobWQbsk2ILD4oqFBxyZM\nNR9Es5LjBwTrpNm9SCWP2DuxoD2LJLnVmliEYe6A+BkFZ5Tng1r1439vUC5m\nF3y2kLCfReZQR5+SjF8H8WYSWhXvVrOnK1qCNg53cyngg953v+SAPZ0FXv7R\nmZ1aBOdcAaJX/6sWEGgi3lTInF3pcDEis3A3B1Xrz459yfk2k8tGfTypSAHB\nZDDw\r\n=7i2f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMIjl7YKhX0+QocwovgGRPEeXBPR+pEnWiTalQoomUfQIhAMTaQONJZbKKHwXQ/0LU92me12eUwe0EieAMe5Lmvmvj"}]},"_npmUser":{"name":"hthetiot","email":"hthetiot@gmail.com"},"maintainers":[{"name":"hthetiot","email":"hthetiot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grunt-nodemon_0.4.6_1625661191062_0.7934516854025386"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-07T12:33:10.695Z","0.4.6":"2021-07-07T12:33:11.181Z","modified":"2022-04-04T17:32:20.740Z"},"maintainers":[{"name":"hthetiot","email":"hthetiot@gmail.com"}],"description":"Grunt task to run a nodemon monitor of your node.js server","homepage":"https://github.com/baladins/grunt-nodemon#readme","keywords":["gruntplugin","nodemon","server"],"repository":{"type":"git","url":"git+https://github.com/baladins/grunt-nodemon.git"},"author":{"name":"Chris Wren"},"bugs":{"url":"https://github.com/baladins/grunt-nodemon/issues"},"license":"MIT","readme":"# grunt-nodemon\n\n## Note: This is not actively maintained, please make an issue if you are interested in helping maintain this project\n\n> Run [nodemon](https://github.com/remy/nodemon) as a grunt task for easy configuration and integration with the rest of your workflow\n\n[![NPM version](https://badge.fury.io/js/grunt-nodemon.png)](http://badge.fury.io/js/grunt-nodemon) [![Dependency Status](https://david-dm.org/ChrisWren/grunt-nodemon.png)](https://david-dm.org/ChrisWren/grunt-nodemon) [![Travis Status](https://travis-ci.org/ChrisWren/grunt-nodemon.png)](https://travis-ci.org/ChrisWren/grunt-nodemon)\n\n## Getting Started\nIf you haven't used grunt before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:\n\n> npm install grunt-nodemon --save-dev\n\nThen add this line to your project's `Gruntfile.js` gruntfile:\n\n```javascript\ngrunt.loadNpmTasks('grunt-nodemon');\n```\n\n## Documentation\n\n### Minimal Usage\nThe minimal usage of grunt-nodemon runs with a `script` specified:\n\n```js\nnodemon: {\n  dev: {\n    script: 'index.js'\n  }\n}\n```\n\n### Usage with all available options set\n\n```js\nnodemon: {\n  dev: {\n    script: 'index.js',\n    options: {\n      args: ['dev'],\n      nodeArgs: ['--debug'],\n      callback: function (nodemon) {\n        nodemon.on('log', function (event) {\n          console.log(event.colour);\n        });\n      },\n      env: {\n        PORT: '8181'\n      },\n      cwd: __dirname,\n      ignore: ['node_modules/**'],\n      ext: 'js,coffee',\n      watch: ['server'],\n      delay: 1000,\n      legacyWatch: true\n    }\n  },\n  exec: {\n    options: {\n      exec: 'less'\n    }\n  }\n}\n```\n\n### Advanced Usage\n\nA common use case is to run `nodemon` with other tasks concurrently. It is also common to open a browser tab when starting a server, and reload that tab when the server code changes. These workflows can be achieved with the following config, which uses a custom [`options.callback`](#callback) function, and [grunt-concurrent](https://github.com/sindresorhus/grunt-concurrent) to run nodemon, [node-inspector](https://github.com/ChrisWren/grunt-node-inspector), and [watch](https://github.com/gruntjs/grunt-contrib-watch) in a single terminal tab:\n\n```js\nconcurrent: {\n  dev: {\n    tasks: ['nodemon', 'node-inspector', 'watch'],\n    options: {\n      logConcurrentOutput: true\n    }\n  }\n},\nnodemon: {\n  dev: {\n    script: 'index.js',\n    options: {\n      nodeArgs: ['--debug'],\n      env: {\n        PORT: '5455'\n      },\n      // omit this property if you aren't serving HTML files and\n      // don't want to open a browser tab on start\n      callback: function (nodemon) {\n        nodemon.on('log', function (event) {\n          console.log(event.colour);\n        });\n\n        // opens browser on initial server start\n        nodemon.on('config:update', function () {\n          // Delay before server listens on port\n          setTimeout(function() {\n            require('open')('http://localhost:5455');\n          }, 1000);\n        });\n\n        // refreshes browser when server reboots\n        nodemon.on('restart', function () {\n          // Delay before server listens on port\n          setTimeout(function() {\n            require('fs').writeFileSync('.rebooted', 'rebooted');\n          }, 1000);\n        });\n      }\n    }\n  }\n},\nwatch: {\n  server: {\n    files: ['.rebooted'],\n    options: {\n      livereload: true\n    }\n  }\n}\n```\n\n*Note that using the callback config above assumes you have `open` installed and are injecting a LiveReload script into your HTML file(s). You can use [grunt-inject](https://github.com/ChrisWren/grunt-inject) to inject the LiveReload script.*\n\n### Required property\n\n#### script\nType: `String`\n\nScript that nodemon runs and restarts when changes are detected.\n\n### Options\n\n#### args\nType: `Array` of `Strings`\n\nList of arguments to be passed to your script.\n\n#### nodeArgs\nType: `Array` of `Strings`\n\nList of arguments to be passed to node. The most common argument is `--debug` or `--debug-brk` to start a debugging server.\n\n#### callback\nType:  `Function`\nDefault:\n\n```js\nfunction(nodemon) {\n  // By default the nodemon output is logged\n  nodemon.on('log', function(event) {\n    console.log(event.colour);\n  });\n};\n```\n\nCallback which receives the `nodemon` object. This can be used to respond to changes in a running app, and then do cool things like LiveReload a web browser when the app restarts. See the [nodemon docs](https://github.com/remy/nodemon/blob/master/doc/events.md#states) for the full list of events you can tap into.\n\n#### ignore\nType: `Array` of `String globs` Default: `['node_modules/**']`\n\nList of ignored files specified by a glob pattern relative to the [watch](#watch)ed folder. [Here](https://github.com/remy/nodemon#ignoring-files) is an explanation of how to use the patterns to ignore files.\n\n#### ext\nType: `String` Default: `'js'`\n\nString with comma separated file extensions to watch. By default, nodemon watches `.js` files.\n\n#### watch\nType: `Array` of `Strings` Default: `['.']`\n\nList of folders to watch for changes. By default nodemon will traverse sub-directories, so there's no need in explicitly including sub-directories.\n\n#### delay\nType: `Number` Default: `1000`\n\nDelay the restart of nodemon by a number of milliseconds when compiling a large amount of files so that the app doesn't needlessly restart after each file is changed.\n\n#### legacyWatch\nType: `Boolean` Default: `false`\n\nIf you wish to force nodemon to start with the legacy watch method. See <https://github.com/remy/nodemon/blob/master/faq.md#help-my-changes-arent-being-detected> for more details.\n\n#### cwd\nType: `String`\n\nThe current working directory to run your script from.\n\n#### env\nType: `Object`\n\nHash of environment variables to pass to your script.\n\n#### exec\nType: `String`\n\nYou can use nodemon to execute a command outside of node. Use this option to specify a command as a string with the argument being the script parameter above. You can read more on exec [here](https://github.com/remy/nodemon#running-non-node-scripts).\n\n## Changelog\n\n**0.4.3** - Updated to nodemon `1.18.10`, fix old tests. Switched to package grunt-markdownlint.\n\n**0.4.2** - Updated peer dependencies.\n\n**0.4.1** - Updated dependencies.\n\n**0.4.0** - Updated dependencies.\n\n**0.3.0** - Updated to nodemon `1.2.0`.\n\n**0.2.1** - Updated README on npmjs.org with correct options.\n\n**0.2.0** - Updated to nodemon 1.0, added new [`callback`](#callback) option.\n\n**Breaking changes:**\n\n- `options.file` is now `script` and is a required property. Some properties were changed to match nodemon: `ignoredFiles` -> `ignore`, `watchedFolders` -> `watch`, `delayTime` -> `delay`, `watchedExtensions` -> `ext`(now a string) to match nodemon.\n\n**0.1.2** - `nodemon` can now be listed as a dependency in the package.json and grunt-nodemon will resolve the nodemon.js file's location correctly.\n\n**0.1.1** - Added `legacyWatch` option thanks to [@jonursenbach](https://github.com/jonursenbach).\n\n**0.1.0** - Removed `debug` and `debugBrk` options as they are encapsulated by the `nodeArgs` option.\n\n**Breaking changes:**\n\n- Configs with the `debug` or `debugBrk` options will no longer work as expected. They simply need to be added to `nodeArgs`.\n\n**0.0.10** - Added `nodeArgs` option thanks to [@eugeneiiim](https://github.com/eugeneiiim).\n\n**0.0.9** - Fixed bug when using `cwd` with `ignoredFiles`.\n\n**0.0.8** - Added error logging for incorrectly installed `nodemon`.\n\n**0.0.7** - Added `debugBreak` option thanks to [@bchu](https://github.com/bchu).\n\n**0.0.6** - Added `env` option.\n\n**0.0.5** - Added `cwd` option.\n\n**0.0.4** - Added `nodemon` as a proper dependency.\n\n**0.0.3** - Uses local version of `nodemon` for convenience and versioning.\n\n**0.0.2** - Removes `.nodemonignore` if it was previously generated and then the `ignoredFiles` option is removed.\n\n**0.0.1** - Added warning if `nodemon` isn't installed as a global module.\n\n**0.0.0** - Initial release\n","readmeFilename":"README.md"}