in this function you are reading the file first and then you start streaming the data and checking it,
you should get the data first and if there is no error in the data or the connection start opening the file,
alway try to reduce your request on the files or database.
the code should look like this
https://github.com/facg3/msn-AutoComplete/blob/8c372d2136eec1a1ef9a7ffdb6da271cd51ef2f3/src/handler.js#L41
in this function you are reading the file first and then you start streaming the data and checking it, you should get the data first and if there is no error in the data or the connection start opening the file, alway try to reduce your request on the files or database. the code should look like this