parseComment = function(comment) {
  // from esdoc (https://github.com/esdoc/esdoc/blob/master/src/Parser/CommentParser.js)
  comment = comment.replace(/\r\n/gm, '\n') // for windows
  comment = comment.replace(/^\t*\s?/gm, '') // remove trailing tab
  comment = comment.replace(/^\*\s?/, '') // remove first '*'
  comment = comment.replace(/ $/, '') // remove last ' '
  comment = comment.replace(/^ *\* ?/gm, '') // remove line head '*'
  if (comment.charAt(0) !== '@')  comment = '@desc ' + comment // auto insert @desc
  comment = comment.replace(/\s*$/, '') // remove tail space.
  comment = comment.replace(/^(@\w+)$/gm, '$1 \\TRUE') // auto insert tag text to non-text tag (e.g. @interface)
  comment = comment.replace(/^(@\w+)\s(.*)/gm, '\\Z$1\\Z$2') // insert separator (\\Z@tag\\Ztext)
  var lines = comment.split('\\Z')

  var tagName = ''
  var tagValue = ''
  var tags = []
  for (var i = 0; i < lines.length; i++) {
    var line = lines[i]
    if (line.charAt(0) === '@') {
      tagName = line
      var nextLine = lines[i + 1]
      if (nextLine.charAt(0) === '@') {
        tagValue = ''
      } else {
        tagValue = nextLine
        i++
      }
      tagValue = tagValue.replace('\\TRUE', '').replace(/^\n/, '').replace(/\n*$/, '')
      var tag = {}
      tag[tagName] = tagValue
      tags.push(tag)
    }
  }
  return tags
}
A little module that extracts the API information from doc comments.
@type {exports|module.exports}