added asynchronous version of new line counter, which is the node.js way