bot/node_modules/npm/lib/utils/read-package-name.js

10 lines
285 B
JavaScript
Raw Normal View History

2022-02-16 11:32:42 +01:00
const { resolve } = require('path')
const readJson = require('read-package-json-fast')
async function readLocalPackageName (prefix) {
const filepath = resolve(prefix, 'package.json')
const json = await readJson(filepath)
return json.name
}
module.exports = readLocalPackageName