Updated JavaScript code for Node Defender