readFileLines
Returns an array of lines from the specified file.
- Use
fs.readFileSync()
to create aBuffer
from a file. - Convert buffer to string using
buf.toString(encoding)
function. - Use
String.prototype.split(\n)
to create an array of lines from the contents of the file.