These are chat archives for node-forward/discussions

Dec 2014
Martin Heidegger
Dec 11 2014 09:35
I have some idea for node that might be interesting: How about a "auto-refresh" command-line option. if any of the loaded and/or required files changed then the process is automatically restarted.
Boopathi Rajaa
Dec 11 2014 09:49
@martinheidegger I don’t think it should be handled at node level. May be the task runner that you use with your projects should be implementing this.
Matt Brennan
Dec 11 2014 11:08
@martinheidegger I believe nodemon can do this.
Dec 11 2014 12:29
Yeah @martinheidegger look up supervisor or nodemon. And while we're at it, also gulp or grunt.
Martin Heidegger
Dec 11 2014 14:33
gulp and/or grunt are not the "automatic-good-to-teach" solutions i am looking for, they are hard to handle properly . I didn't know that nodemon was able to do that (last time i checked it didn't). pm2 seems to support it too (sweet). The argument in my head to support it on a platform level was that beginners struggle with the running of apps very often. "I changed the file, why does the server not update?" "Why do I have to restart now?", ... I recognised this topic when I talked with a Meteor developer. He simply assumed that live-reload is normal and every tool supports it. I found it very nice way to think.
Dec 11 2014 16:19

That's actually a legacy from PHP, RoR and similar, I think - to expect stuff to reload automatically.

As for automatic-good-to-teach solutions, I prefer gulp over grunt as grunt is more configuration, gulp looks like regular node.js code.

So you might learn something using it.
But the thing is - you start learning good practices: like using a proper tooling for everything. When you work with, say, Java, and do a change, Eclipse will save the stuff for you, compile, hot-load the class or reload the app or something, so you deal with development, not with minifying assets or bootstraping stuff, you get a nice workflow that most Node.js developers will be able to understand and follow.
Anyway, I didn't see you ask for a 'good-to-teach' solution, you asked about restarting node.js and apps on the platform level. People (including me) suggested existing solutions like supervisor and nodemon and as you say, pm2. I think it's still a part of the platform as those are the typical tools you'd use anyway.
But since they do help you out some, I suggested that you also look into gulp or grunt.
So, maybe a misunderstanding on my side :smile:
Anyway, there you go.
Dec 11 2014 16:23
Enter Yeomen.
Jason Rhodes
Dec 11 2014 16:47
+1 for nodemon
Dec 11 2014 17:43
Does one of the node core classes introduce nodemon?
Martin Heidegger
Dec 11 2014 19:27
@zladuric I don't suggest that this --watch switch should be there by default but at least as option. There is a reason why it has been successful in PHP/RoR/...