Three things come to my mind:
- You could just call
process.exit. This for sure brings your application to a state where it needs to be restarted. - The other option might be to run an endless loop, something such as
while (true) {}. This should make Node.js use 100% of your CPU, and hence the application should be restarted as well (although this, of course, means that you / someone has to watch your application). - Create a module in C that crashes by e.g. trying to access a random place in memory. I have no such module at hand, but I’m pretty sure that it should be quite easy for someone with C skills to write such a module.