<commit_before>const path = require('path')

module.exports = (name, spec, result) => {
  spec = spec.replace('file:', '')
  if (spec[0] === '~') {
    spec = path.join(process.env.HOME, spec.slice(1))
  }
  spec = path.resolve(spec)
  const pkgJSON = spec.indexOf('package.json') !== -1
    ? spec
    : path.join(spec, 'package.json')
  return new Promise((resolve, reject) => {
    try {
      const pkg = require(pkgJSON)
      resolve({
        type: 'local',
        version: pkg.version,
        dependencies: pkg.dependencies,
        url: spec
      })
    } catch (e) { reject(e) }
  })
}<commit_msg>fix(install): path is already resolved by fetchSpec<commit_after>const path = require('path')

module.exports = (name, spec, result) => {
  const pkgJSON = spec.indexOf('package.json') !== -1
    ? spec
    : path.join(spec, 'package.json')
  return new Promise((resolve, reject) => {
    try {
      const pkg = require(pkgJSON)
      resolve({
        type: 'local',
        version: pkg.version,
        dependencies: pkg.dependencies,
        url: spec
      })
    } catch (e) { reject(e) }
  })
}
{'fraction_non_alphanumeric': 0.16636690647482014, 'fraction_numerical': 0.0035971223021582736, 'mean_word_length': 2.6372549019607843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4317583', 'n_tokens_mistral': 367, 'n_tokens_neox': 355, 'n_words': 83}