{"_id":"find-npm-prefix","_rev":"37-40e63435f0ba07bdf78d5f43977505d6","name":"find-npm-prefix","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"find-npm-prefix","version":"1.0.0","keywords":[],"author":{"url":"http://re-becca.org/","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","_id":"find-npm-prefix@1.0.0","maintainers":[{"name":"iarna","email":"me@re-becca.org"}],"homepage":"https://github.com/npm/find-npm-prefix#readme","bugs":{"url":"https://github.com/npm/find-npm-prefix/issues"},"dist":{"shasum":"d258719697b66c22d1afb19fbe3107f93295a0de","tarball":"https://registry.npmjs.org/find-npm-prefix/-/find-npm-prefix-1.0.0.tgz","integrity":"sha512-2yMAwn+mWFo+yZtIXc0NqEkkRsyXmDUaaYijBs2Orhts0KX2/ftBM0/+CXSuDaA8k+NvpprKAH1ObLApAu6S0g==","signatures":[{"sig":"MEYCIQDKQmUQL9DR8chSFcMxxTYxNnSWSqOFvHce+FYD/M7ldAIhAKXF9dpSy26Hx1ai3R5ghxccJQzcXOcBxlduTrKo5fRX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"find-prefix.js","gitHead":"ab0e964dc1990958142af17271c0b57e6f1d3076","scripts":{"test":"standard && tap --100 test"},"_npmUser":{"name":"iarna","email":"me@re-becca.org"},"deprecated":"This package is no longer supported.","repository":{"url":"git+https://github.com/npm/find-npm-prefix.git","type":"git"},"_npmVersion":"5.5.1","description":"Find the npm project directory associated with for a given directory","directories":{"test":"test"},"_nodeVersion":"8.5.0","dependencies":{},"devDependencies":{"tap":"^10.7.3","standard":"^10.0.3","require-inject":"^1.4.2"},"_npmOperationalInternal":{"tmp":"tmp/find-npm-prefix-1.0.0.tgz_1510143679013_0.9125222719740123","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"find-npm-prefix","version":"1.0.1","keywords":[],"author":{"url":"http://re-becca.org/","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","_id":"find-npm-prefix@1.0.1","maintainers":[{"name":"iarna","email":"me@re-becca.org"}],"homepage":"https://github.com/npm/find-npm-prefix#readme","bugs":{"url":"https://github.com/npm/find-npm-prefix/issues"},"dist":{"shasum":"af0faa74e19294b3c8634bae0e91017bb5adfac2","tarball":"https://registry.npmjs.org/find-npm-prefix/-/find-npm-prefix-1.0.1.tgz","integrity":"sha512-I9R7ZnsjlKRvXBJjA1PE4wAkSc24YChoomWdEPTZgeB4DHxf87OutNGV5McFj6WwPghH97nZRejH58XvY6ga6Q==","signatures":[{"sig":"MEYCIQDefB1aEedeCIzDQUarnbOUVGefQynVIX7q5zlFLBxNkgIhANHrYiul5kygZoAU/gsojzGLUEwA5X3FTiDWln7BmVad","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"find-prefix.js","gitHead":"4b04e19db1708984b91d00da7d77b2a12f27e5f5","scripts":{"test":"standard && tap --100 test"},"_npmUser":{"name":"iarna","email":"me@re-becca.org"},"deprecated":"This package is no longer supported.","repository":{"url":"git+https://github.com/npm/find-npm-prefix.git","type":"git"},"_npmVersion":"5.5.1","description":"Find the npm project directory associated with for a given directory","directories":{"test":"test"},"_nodeVersion":"4.8.4","dependencies":{},"devDependencies":{"tap":"^10.7.3","standard":"^10.0.3","require-inject":"^1.4.2"},"_npmOperationalInternal":{"tmp":"tmp/find-npm-prefix-1.0.1.tgz_1510149299099_0.07040145457722247","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"find-npm-prefix","version":"1.0.2","keywords":[],"author":{"url":"http://re-becca.org/","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","_id":"find-npm-prefix@1.0.2","maintainers":[{"name":"iarna","email":"me@re-becca.org"}],"homepage":"https://github.com/npm/find-npm-prefix#readme","bugs":{"url":"https://github.com/npm/find-npm-prefix/issues"},"dist":{"shasum":"8d8ce2c78b3b4b9e66c8acc6a37c231eb841cfdf","tarball":"https://registry.npmjs.org/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz","integrity":"sha512-KEftzJ+H90x6pcKtdXZEPsQse8/y/UnvzRKrOSQFprnrGaFuJ62fVkP34Iu2IYuMvyauCyoLTNkJZgrrGA2wkA==","signatures":[{"sig":"MEUCIC5F729aeIGRKRPbxWZGINW3EdquKgNTF81H6AXFPVPhAiEA6oxQCSL4SruEJD9e0dB3qFwjLsAk2eUDhua1vbGN2zQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"find-prefix.js","gitHead":"c90ffc067b8fd9dfba3bbc41d53bd114a1780b00","scripts":{"test":"standard && tap --100 test"},"_npmUser":{"name":"iarna","email":"me@re-becca.org"},"deprecated":"This package is no longer supported.","repository":{"url":"git+https://github.com/npm/find-npm-prefix.git","type":"git"},"_npmVersion":"5.5.1","description":"Find the npm project directory associated with for a given directory","directories":{"test":"test"},"_nodeVersion":"8.9.1","dependencies":{},"devDependencies":{"tap":"^10.7.3","standard":"^10.0.3","require-inject":"^1.4.2"},"_npmOperationalInternal":{"tmp":"tmp/find-npm-prefix-1.0.2.tgz_1511224267412_0.8366058212704957","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-11-08T12:21:19.972Z","modified":"2026-04-22T19:42:03.812Z","1.0.0":"2017-11-08T12:21:19.972Z","1.0.1":"2017-11-08T13:54:59.973Z","1.0.2":"2017-11-21T00:31:07.473Z"},"bugs":{"url":"https://github.com/npm/find-npm-prefix/issues"},"author":{"url":"http://re-becca.org/","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","homepage":"https://github.com/npm/find-npm-prefix#readme","keywords":[],"repository":{"url":"git+https://github.com/npm/find-npm-prefix.git","type":"git"},"description":"Find the npm project directory associated with for a given directory","maintainers":[{"email":"saquibkhan@github.com","name":"saquibkhan"},{"email":"npm-cli+bot@github.com","name":"npm-cli-ops"},{"email":"reggi@github.com","name":"reggi"},{"email":"owlstronaut@github.com","name":"owlstronaut"}],"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","readmeFilename":"README.md"}