Can not make task work

Hi! I am trying to submit a NodeJS task, but it seems I do something wrong. Here is my code, reading data from stdin:


let data = '';
process.stdin.on('data', function (chunk) {
	data = data + chunk.toString();

process.stdin.on('end', function (chunk) {
        // do something with my data

If I run my code with Run button - it says that everything is ok, but after I Submit task - it shows Status: Wrong answer Time: 0.00sec. But it can not be 0 sec! So, presumably, I did not get input?

I tested this code locally and it is works fine with command like: node app < input.txt

Learn NodeJS from PROs