• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict'
2var moduleName = require('./module-name.js')
3
4module.exports = function (tree) {
5  var pkg = tree.package || tree
6  // FIXME: Excluding the '@' here is cleaning up after the mess that
7  // read-package-json makes. =(
8  if (pkg._id && pkg._id !== '@') return pkg._id
9  var name = moduleName(tree)
10  if (pkg.version) {
11    return name + '@' + pkg.version
12  } else {
13    return name
14  }
15}
16