You can use 2 most probable ways.

if you want to know immediately whether out of 10 programs, if any of them goes offline then you should use Socket.io


Your server nodejs program will act as server and your 10 desktop program will work as client. Your 10 client socket connection will connect with server socket connection and server socket can check whether socket client is still connected or not based on Ping/Pong concept of socket.

in brief, Ping/pong technique in which server sends Ping event on socket connection and client will receive server's ping event and send Pong event back to server.
if client is not sending Pong event back in predefined time interval on getting Ping event then that client is offline or disconnected.

You can periodically (say every 1/5/10 minutes etc ) call simple HTTP request and check if response status is 200 or not. If any of the 10 desktop program is offline then you will know it by response status whether it is 200 or not.
Let me describe it as briefly and clearly as possible:
I have 10 different copies of a node JS based program running on 10 different desktops. I want to create a Node JS based (or any other technology) web app deployed on a server which will check if these 10 programs are online or not.
Any suggestions as to how I can implement this?
Note: The node JS based desktop apps are running on electron.
Node JS detect connectivity to all Node JS programs