code: function parse (packageName) {
    if (!packageName || !packageNameRegexp.test(packageName)) {
      return null
    }
  
    const slashIndex = packageName.indexOf('/')
    const atLastIndex = packageName.lastIndexOf('@')
    const hasScope = slashIndex !== -1
    const hasVersion = atLastIndex !== -1 && atLastIndex !== 0
  
    let scope = ''
    let name = ''
    let version = ''
  
    if (hasScope && hasVersion) {
      scope = packageName.slice(1, slashIndex)
      name = packageName.slice(slashIndex + 1, atLastIndex)
      version = packageName.slice(atLastIndex + 1)
    } else if (hasScope) {
      scope = packageName.slice(1, slashIndex)
      name = packageName.slice(slashIndex + 1)
    } else if (hasVersion) {
      name = packageName.slice(slashIndex + 1, atLastIndex)
      version = packageName.slice(atLastIndex + 1)
    } else {
      name = packageName
    }
  
    return {
      name: normalize(name),
      scope,
      version
    }
  }
docs: @typedef ParsedPackageName
  @property {string} name 包名
  @property {string} [version] 版本
  @property {string} [scope] scope
   
  解析 npm package name
  
  @param {string} packageName 包名
  @returns {ParsedPackageName} parsed obj