How do I remove the newline from this code:
socket.on('data', function(data){ console.log('Data in server, sending to handle()'); worker.handle(data, socket); }); Worker.handle():
exports.handle = function handle(command, socket) { console.log('Data sent to handle()'); command = command.toString(); console.log(command); ? Any help will be very appreciated!
Edit: I am getting this output: test data [newline]
Edit 2: Here is the continuing code:
if (command === 'look') { // stuff } if (command === 'login') { // stuff