workshopper/learnyounode

MY FIRST ASYNC I/O! - Not accepting solution with Promises

shivangg opened this issue · 1 comments

The outputs match but the solutions fails without any reason

const fs = require('fs');
const util = require('util');
const readFile = util.promisify( fs.readFile );

readFile(process.argv[2])
.then( data => {
  let fileContentsLength = data.toString().split('\n').length - 1;
  console.log(fileContentsLength);
})
.catch( err => {
  console.error(err);
});

Output
image

This issue can be closed as it has been fixed in v4.0.1.

PR for reference: #667