{"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"keywords":["package","json","root","npm","entry","find","up","find-up","findup","look-up","look","file","search","match","resolve","parent","parents","folder","directory","dir","walk","walking","path"],"dist-tags":{"latest":"2.0.0"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"description":"Find the root directory of a Node.js project or npm package","readme":"# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir)\n\n> Find the root directory of a Node.js project or npm package\n\n\n## Install\n\n```\n$ npm install --save pkg-dir\n```\n\n\n## Usage\n\n```\n/\n└── Users\n    └── sindresorhus\n        └── foo\n            ├── package.json\n            └── bar\n                ├── baz\n                └── example.js\n```\n\n```js\n// example.js\nconst pkgDir = require('pkg-dir');\n\npkgDir(__dirname).then(rootDir => {\n\tconsole.log(rootDir);\n\t//=> '/Users/sindresorhus/foo'\n});\n```\n\n\n## API\n\n### pkgDir([cwd])\n\nReturns a `Promise` for either the project root path or `null` if it couldn't be found.\n\n### pkgDir.sync([cwd])\n\nReturns the project root path or `null`.\n\n#### cwd\n\nType: `string`<br>\nDefault: `process.cwd()`\n\nDirectory to start from.\n\n\n## Related\n\n- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module\n- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file\n- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-dir.git"},"users":{"recursion_excursion":true,"ahmed-dinar":true,"rocket0191":true,"hugojosefson":true},"bugs":{"url":"https://github.com/sindresorhus/pkg-dir/issues"},"license":"MIT","versions":{"1.0.0":{"name":"pkg-dir","version":"1.0.0","description":"Find the root directory of a npm package","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/pkg-dir"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["package","json","root","npm","entry","find","up","find-up","findup","look-up","look","file","search","match","package","resolve","parent","parents","folder","directory","dir","walk","walking","path"],"dependencies":{"find-up":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"a06a60b1a2cddf2f84912221477311327398da01","bugs":{"url":"https://github.com/sindresorhus/pkg-dir/issues"},"homepage":"https://github.com/sindresorhus/pkg-dir","_id":"pkg-dir@1.0.0","_shasum":"7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/pkg-dir/-/pkg-dir-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"2.0.0":{"name":"pkg-dir","version":"2.0.0","description":"Find the root directory of a Node.js project or npm package","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/pkg-dir.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["package","json","root","npm","entry","find","up","find-up","findup","look-up","look","file","search","match","resolve","parent","parents","folder","directory","dir","walk","walking","path"],"dependencies":{"find-up":"^2.1.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"c18df2945cd928787f3290042a6c69352b4e13a5","bugs":{"url":"https://github.com/sindresorhus/pkg-dir/issues"},"homepage":"https://github.com/sindresorhus/pkg-dir#readme","_id":"pkg-dir@2.0.0","_shasum":"f6d5d1109e19d63edf428e0bd57e12777615334b","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f6d5d1109e19d63edf428e0bd57e12777615334b","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/pkg-dir/-/pkg-dir-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pkg-dir-2.0.0.tgz_1493912348467_0.855934705818072"},"directories":{}}},"name":"pkg-dir","time":{"modified":"2017-08-05T10:24:37.670Z","created":"2015-09-01T07:59:42.497Z","1.0.0":"2015-09-01T07:59:42.497Z","2.0.0":"2017-05-04T15:39:08.692Z"},"readmeFilename":"readme.md","homepage":"https://github.com/sindresorhus/pkg-dir#readme"}