lib/index.js
function countLines (str) {
  if (str) {
    let lines = str.match(/\n/g);
    if (lines) {
      return lines.length;
    }
  }
  return 0;
}
function countLines (str) {
  if (str) {
    let lines = str.match(/\n/g);
    if (lines) {
      return lines.length;
    }
  }
  return 0;
}
function countLines ( str ) { if ( str ) { let lines = str . match ( / \n / g ) ; if ( lines ) { return lines . length ; } } return 0 ; }
Counts the number of lines in the given string

@param {string} str
@returns {number}
Counts the number of lines in the given string