mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-29 20:41:47 -04:00
17 lines
339 B
JavaScript
17 lines
339 B
JavaScript
var debug = require('debug')('unpm:get_path')
|
|
var dirname = require('path').dirname
|
|
var readPkgUp = require('read-pkg-up')
|
|
|
|
/*
|
|
* Returns the path of package.json.
|
|
*/
|
|
|
|
module.exports = function getPath () {
|
|
return readPkgUp()
|
|
.then(function (pkg) {
|
|
debug('root: ' + dirname(pkg.path))
|
|
return dirname(pkg.path)
|
|
})
|
|
}
|
|
|