"value":"\n <p>Instead of running the same commands over and over again, some of the command-line tools that I use have a <code>watch<\/code> mode and will automatically re-run when files are changed, however, not all do.<\/p>\n\n<p>Instead of doing this manually, I can achieve the same thing though using a tool called <code>nodemon<\/code> - a script monitor for node projects, but it can work with non-node projects too.<\/p>\n\n<p>Here's an example where I'm automatically re-running my PHPUnit tests using a <code>just test<\/code> recipe each time a file within my custom modules directory changes:<\/p>\n\n<pre><code>nodemon \\\n --watch web\/modules\/custom \\\n --ext '*' \\\n --exec \"just test --stop-on-failure --colors=always\"\n<\/code><\/pre>\n\n<p>I specify the files or directories I want to watch, which file extensions should trigger a restart (in this case, I've enabled all extensions), and the command to execute.<\/p>\n\n<p>This watches all files and run all of the tests, but I can filter either if I need to.<\/p>\n\n<p>As well as PHP tools like PHPUnit and PHPStan, I also use this for other things such as when creating presentation slides with rst2pdf where I can automatically re-generate the PDF whenever I update the rst file.<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>Instead of running the same commands over and over again, some of the command-line tools that I use have a <code>watch<\/code> mode and will automatically re-run when files are changed, however, not all do.<\/p>\n\n<p>Instead of doing this manually, I can achieve the same thing though using a tool called <code>nodemon<\/code> - a script monitor for node projects, but it can work with non-node projects too.<\/p>\n\n<p>Here's an example where I'm automatically re-running my PHPUnit tests using a <code>just test<\/code> recipe each time a file within my custom modules directory changes:<\/p>\n\n<pre><code>nodemon \\\n --watch web\/modules\/custom \\\n --ext '*' \\\n --exec \"just test --stop-on-failure --colors=always\"\n<\/code><\/pre>\n\n<p>I specify the files or directories I want to watch, which file extensions should trigger a restart (in this case, I've enabled all extensions), and the command to execute.<\/p>\n\n<p>This watches all files and run all of the tests, but I can filter either if I need to.<\/p>\n\n<p>As well as PHP tools like PHPUnit and PHPStan, I also use this for other things such as when creating presentation slides with rst2pdf where I can automatically re-generate the PDF whenever I update the rst file.<\/p>\n\n ",