JavaScript equivalent of node-daemon?

The code you write for a function node is already inside the "on input" call. Inside a function node you can just use local in memory context eg. context.myvar rather than set get.