open a new terminal and run npm install to init publish service run node pub.js to init subscribe service run in a new terminal node sub.js