I have installed nodejs with the following paths: ./server.js ./node_modules/ws/lib/ws ./node_modules/ws/lib/Receiver.js In server.js script I declare array var clients = [] Question: How can the readBuffer (bytes) function of the Receiver.js class have access to the declared global variable in the server.js file? Thank you very much for helping me.