{"_id":"find-npm-prefix","_rev":"143635","name":"find-npm-prefix","description":"Find the npm project directory associated with for a given directory","dist-tags":{"latest":"1.0.2"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"gar","email":""},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"nlf","email":""},{"name":"npm-cli-ops","email":""},{"name":"saquibkhan","email":""}],"time":{"modified":"2021-06-03T11:28:28.000Z","created":"2017-11-08T12:21:19.972Z","1.0.2":"2017-11-21T00:31:07.473Z","1.0.1":"2017-11-08T13:54:59.973Z","1.0.0":"2017-11-08T12:21:19.972Z"},"users":{},"author":{"name":"Rebecca Turner","email":"me@re-becca.org","url":"http://re-becca.org/"},"repository":{"type":"git","url":"git+https://github.com/npm/find-npm-prefix.git"},"versions":{"1.0.2":{"name":"find-npm-prefix","version":"1.0.2","description":"Find the npm project directory associated with for a given directory","main":"find-prefix.js","scripts":{"test":"standard && tap --100 test"},"keywords":[],"author":{"name":"Rebecca Turner","email":"me@re-becca.org","url":"http://re-becca.org/"},"license":"ISC","devDependencies":{"require-inject":"^1.4.2","standard":"^10.0.3","tap":"^10.7.3"},"directories":{"test":"test"},"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/npm/find-npm-prefix.git"},"bugs":{"url":"https://github.com/npm/find-npm-prefix/issues"},"homepage":"https://github.com/npm/find-npm-prefix#readme","gitHead":"c90ffc067b8fd9dfba3bbc41d53bd114a1780b00","_id":"find-npm-prefix@1.0.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"8d8ce2c78b3b4b9e66c8acc6a37c231eb841cfdf","size":2582,"noattachment":false,"key":"/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/find-npm-prefix/download/find-npm-prefix-1.0.2.tgz"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"gar","email":""},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"nlf","email":""},{"name":"npm-cli-ops","email":""},{"name":"saquibkhan","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/find-npm-prefix-1.0.2.tgz_1511224267412_0.8366058212704957"},"publish_time":1511224267473,"_hasShrinkwrap":false,"_cnpm_publish_time":1511224267473},"1.0.1":{"name":"find-npm-prefix","version":"1.0.1","description":"Find the npm project directory associated with for a given directory","main":"find-prefix.js","scripts":{"test":"standard && tap --100 test"},"keywords":[],"author":{"name":"Rebecca Turner","email":"me@re-becca.org","url":"http://re-becca.org/"},"license":"ISC","devDependencies":{"require-inject":"^1.4.2","standard":"^10.0.3","tap":"^10.7.3"},"directories":{"test":"test"},"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/npm/find-npm-prefix.git"},"bugs":{"url":"https://github.com/npm/find-npm-prefix/issues"},"homepage":"https://github.com/npm/find-npm-prefix#readme","gitHead":"4b04e19db1708984b91d00da7d77b2a12f27e5f5","_id":"find-npm-prefix@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"4.8.4","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"af0faa74e19294b3c8634bae0e91017bb5adfac2","size":2570,"noattachment":false,"key":"/find-npm-prefix/-/find-npm-prefix-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/find-npm-prefix/download/find-npm-prefix-1.0.1.tgz"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"gar","email":""},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"nlf","email":""},{"name":"npm-cli-ops","email":""},{"name":"saquibkhan","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/find-npm-prefix-1.0.1.tgz_1510149299099_0.07040145457722247"},"publish_time":1510149299973,"_hasShrinkwrap":false,"_cnpm_publish_time":1510149299973},"1.0.0":{"name":"find-npm-prefix","version":"1.0.0","description":"Find the npm project directory associated with for a given directory","main":"find-prefix.js","scripts":{"test":"standard && tap --100 test"},"keywords":[],"author":{"name":"Rebecca Turner","email":"me@re-becca.org","url":"http://re-becca.org/"},"license":"ISC","devDependencies":{"require-inject":"^1.4.2","standard":"^10.0.3","tap":"^10.7.3"},"directories":{"test":"test"},"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/npm/find-npm-prefix.git"},"bugs":{"url":"https://github.com/npm/find-npm-prefix/issues"},"homepage":"https://github.com/npm/find-npm-prefix#readme","gitHead":"ab0e964dc1990958142af17271c0b57e6f1d3076","_id":"find-npm-prefix@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.5.0","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"d258719697b66c22d1afb19fbe3107f93295a0de","size":2566,"noattachment":false,"key":"/find-npm-prefix/-/find-npm-prefix-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/find-npm-prefix/download/find-npm-prefix-1.0.0.tgz"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"gar","email":""},{"name":"lukekarrys","email":"luke@lukekarrys.com"},{"name":"nlf","email":""},{"name":"npm-cli-ops","email":""},{"name":"saquibkhan","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/find-npm-prefix-1.0.0.tgz_1510143679013_0.9125222719740123"},"publish_time":1510143679972,"_hasShrinkwrap":false,"_cnpm_publish_time":1510143679972}},"readme":"# find-npm-prefix\n\nFind the npm project directory associated with for a given directory\n\n## USAGE\n\n```\nconst findPrefix = require('find-npm-prefix')\n\nfindPrefix(process.cwd).then(prefix => {\n  …\n})\n```\n\n## findPrefix(dir) → Promise(prefix)\n\nThis computes the npm prefix, that is, the directory that npm adds and\nremoves modules from for a given path. \n\nIt takes a directory as an argument and returns a promise of the associated\nprefix directory.\n\n## Algorithm\n\n1. If the directory is a `node_modules` folder, scan up the tree till you find a non-`node_modules` directory and return that.\n2. Else, look for the first parent directory that contains a `node_modules` or a `package.json`\n  1. If one is found, that's the prefix.\n  2. If none are found, return the original directory we were given\n","_attachments":{},"homepage":"https://github.com/npm/find-npm-prefix#readme","bugs":{"url":"https://github.com/npm/find-npm-prefix/issues"},"license":"ISC"}