unix-wc-l Fast wc -l <filename> promise for node.js. (from Emil Vikström SO answer to Node.js: Count the number of lines in a file) var wcL = require('unix-wc-l') wcL('test.txt').then((nlines) => { console.log(`test.txt has ${nlines} lines`) })