JavaScript equivalent of node-daemon?

The way you describe it, this is exactly what node-red is and does.