code: function getPrefix(mod) {
    var n = 'node_modules'
    var i = mod.lastIndexOf(n)
    return ~i ? mod.slice(0, i + n.length) : ''
  }
docs: Returns the path up to the last occurence of `node_modules` or an
  empty string if the path does not contain a node_modules dir.