Does your JavaScript run in a browser? Or is you app based on node.js?
If your code runs in the browser, it seems you question has already been answered here: How to input data from a text file
Does your JavaScript run in a browser? Or is you app based on node.js?
If your code runs in the browser, it seems you question has already been answered here: How to input data from a text file