{"name":"resolve-package-path","description":"a special purpose fast memoizing way to resolve a node modules package.json","version":"1.0.10","main":"index.js","license":"MIT","dependencies":{"path-root":"^0.1.1","resolve":"^1.10.0"},"devDependencies":{"chai":"^4.2.0","execa":"^1.0.0","fixturify-project":"^1.7.0","fs-extra":"^7.0.1","mocha":"^6.0.2","semver":"^5.6.0"},"scripts":{"test":"mocha tests","test:debug":"mocha debug tests"},"gitHead":"ae7a55c1097730bc754879154599c8d840b8f453","_id":"resolve-package-path@1.0.10","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"stefanpenner","email":"stefan.penner@gmail.com"},"dist":{"integrity":"sha512-IUaFIscNcboxMYZZ3NydRea3+7JngEW8BibZlvn4ync97ckAd45B5Hwj58gjR25IHtwTxPjz8NBAusBJKVcyZw==","shasum":"8514b2dae3909c920c4346d8b3811761301b32c5","tarball":"http://registry-npm.ywwl.com/resolve-package-path/download/resolve-package-path-1.0.10.tgz","fileCount":14,"unpackedSize":97798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcewiSCRA9TVsSAnZWagAAxyIP/RirQqMOTAsuBzZ+3c8R\nSKXii/lPDhiPuDG4/ma6kxU4CFTyn4OAO16t6Pp43rc0uZwV47adgAED+dHR\nqpSedPVbvZj7a4c22wxDkY+YZPJ6VnKxfjb2Lsg0vTzWp4sZvBC0EQAzEScd\nfWwv6mUrqULlmSaLofAHJwkWe4EVkpapm/Vy0crJvw/NYphT1E8iSlfMKRwW\nzZfE20DPLjGOdvx1QkDGUhyWQuZny55wjfpn307SQvFPXMD7D00eIj0Ei8Vt\nZqgEaylFol0gJC9XWtPPdpRMUibWx9zaqELEBZN+fu2vKIibrAehhsoI5giU\nXbLqZr/r8UZPg1X9G+B0nSYFrX8vjL6saARyVzczdF916SwbM4ws8/SIIS5I\n7EPJ0IBcxqc7pNB3SsvXTKx+QUBTjxMS7omaPUYQe7rNbl9s9WpAgJFBRfim\nCbTaLWBdeswzrw8fWbpAiWWLswthoABBNW28E02hQAPd1Na+VYAULnI2zX10\n9Vcte0JnGAMTcfJM4zOo8q5qozJdGkG3f+QC8FX+gXZ8jcBtMBHElkzzXI04\n2DJueuoM2WKkvjBgoe0VIudEbY038P+wdxmcxpqbD3EKfJ2XSH7QteyR2Ol7\nS39W6igFMWQxNRCaVEA0jYEJ1rWfJfD8WcaTwoo+aK6dCNAwbBMqUOzYMnPJ\nCF1v\r\n=SxFx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGVdusW5UcyDoRkVt5+wINITdJXcb6fWmUHfSTnoL/D0AiEAi+UqvEGKHKHQTVzz744dtr/fy5mCyE2qyTfmThUf/ic="}],"size":35558,"noattachment":false,"key":"/resolve-package-path/-/resolve-package-path-1.0.10.tgz"},"maintainers":[{"name":"stefanpenner","email":"stefan.penner@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-package-path_1.0.10_1551566993902_0.6977102085624474"},"_hasShrinkwrap":false,"readme":"# resolve-package-path [![CI](https://github.com/stefanpenner/resolve-package-path/workflows/CI/badge.svg)](https://github.com/stefanpenner/resolve-package-path/actions/workflows/ci.yml)\n\nThis project is special-purpose, made to resolve `package.json` files for:\n\n  - a given module name and basedir or\n  - a given basedir\n\nIt cannot and does not resolve anything else.\n\nTo achieve its file-resolution performance, it does two specific things:\n\n- It memoizes results identically to node's `require`. Specifically,\n  for a given moduleName and baseDir it will, for the duration of the process,\n  always return the exact same response.\n\n- It re-implements the parts of `require.resolve` needed to resolve package.json\n  files ONLY. This removes unneeded I/O. (based on @davecombs approach)\n\n## Usage\n\n```sh\nyarn add resolve-package-path\n```\n\n```js\nconst resolvePackagePath = require('resolve-package-path');\n\nresolvePackagePath('rsvp', 'base-dir/to/start/the/node_resolution-algorithm-from') // => /path/to/rsvp.json or null\n\nconst { findUpPackagePath } = resolvePackagePath;\nfindUpPackagePath('base-dir/to/start') // => path/to/package.json or null\n```\n\n## Advanced usage\n\n### Preserve Symlinks\n\nNode supports `--preserve-symlinks` and `NODE_PRESERVE_SYMLINKS=1` for compatibility this library respects these.\n\n### Disable default caching\n\nAlthough by default `resolve-package-path` caches or memoizes results, this feature can be disabled:\n\n```js\nconst resolvePackagePath = require('resolve-package-path');\n\nresolvePackagePath('rsvp', 'base-dir/to/start/the/node_resolution-algorithm-from', false) // => uncached result /path/to/rsvp.json or null\n\nconst { findUpPackagePath } = resolvePackagePath;\nfindUpPackagePath('base-dir/to/start', false) // => path/to/package.json or null\n```\n\n### Purge the cache\n\n```js\nconst resolvePackagePath = require('resolve-package-path');\nresolvePackagePath._resetCache();\n```\n\n### Provide an alternative cache\n\nIn some advanced circumtances, you may want to gain access to the cache to share between more systems.\nIn that case, a cache instance of the following form can be provided as a third argument:\n\n```js\ncache = {\n  RESOLVED_PACKAGE_PATH: new Map(),\n  REAL_FILE_PATH: new Map(),\n  REAL_DIRECTORY_PATH: new Map(),\n};\nfindUpCache = new Map();\n\nconst resolvePackagePath = require('resolve-package-path');\nresolvePackagePath('rsvp', 'path/to/start/from', cache);\n\nconst { findUpPackagePath } = resolvePackagePath;\nfindUpPackagePath('base-dir/to/start', findUpCache) // => path/to/package.json or null\n```\n\n### Use internal helper functions\n\nFor consumers who also do `getRealFilePath` or\n`getRealDirectoryPath` calls on relevant paths, we expose them as utilities.\nThese utilties ensure identical functionality to resolve-package-path, and a\nshared cache, which may help reduce IO.\n","publish_time":1551566994152,"_cnpm_publish_time":1551566994152,"dist-tags":{"latest":"4.0.3"}}