Urara-Blog/node_modules/.pnpm-store/v3/files/07/ff2384c5d482d931856b9f5cc76cfab4011f1cd1a1dac5b7c8c202e17115bbe35ca574b4a5b0b7e51018794bd52f411cef151b1035c5a8cab41d3dde7e1e10
2022-08-14 01:14:53 +08:00

31 lines
980 B
Text

/**
* @module read-package-json
* @author Toru Nagashima
* @copyright 2016 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
"use strict"
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const joinPath = require("path").join
const readPkg = require("read-pkg")
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* Reads the package.json in the current directory.
*
* @returns {object} package.json's information.
*/
module.exports = function readPackageJson() {
const path = joinPath(process.cwd(), "package.json")
return readPkg(path).then(body => ({
taskList: Object.keys(body.scripts || {}),
packageInfo: { path, body },
}))
}