I am trying to extract the first line of a file using npm firstline (https://www.npmjs.com/package/firstline) package using the following line of code
const firstline = require("firstline");
console.log("First line of the file: " + firstline("home/assets/sample.txt");
however it returns First line of the file: [object Promise]
as output.
content of file "home/assets/sample.txt" is as follows
abc
def
ghi
Therefore, I expect "abc" as output. what I am missing?