mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 21:13:12 +00:00

PR-URL: https://github.com/nodejs/node/pull/38880 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruy Adorno <ruyadorno@github.com>
10 lines
285 B
JavaScript
10 lines
285 B
JavaScript
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
|