{"name":"resolve-package-path","description":"a special purpose fast memoizing way to resolve a node modules package.json","version":"3.0.1","repository":{"type":"git","url":"git+ssh://git@github.com/stefanpenner/resolve-package-path.git"},"main":"index.js","types":"index.d.ts","license":"MIT","dependencies":{"path-root":"^0.1.1","resolve":"^1.17.0"},"devDependencies":{"@types/chai":"^4.2.13","@types/fs-extra":"^9.0.2","@types/mocha":"^8.0.3","@types/node":"^14.11.8","@typescript-eslint/eslint-plugin":"^4.4.1","@typescript-eslint/parser":"^4.4.1","chai":"^4.2.0","eslint":"^7.11.0","eslint-config-prettier":"^6.12.0","eslint-plugin-mocha":"^8.0.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.4","execa":"^4.0.3","fixturify-project":"^2.1.0","fs-extra":"^9.0.1","mocha":"^8.1.3","npm-run-all":"^4.1.5","prettier":"^2.1.2","typescript":"^4.0.3"},"scripts":{"build":"tsc -b .","watch":"tsc --watch .","clean":"tsc -b --clean .","test":"npm-run-all build lint test:js","test:js":"mocha tests/*-test.js","test:js:debug":"mocha debug tests/*-test.js","lint":"eslint ."},"engines":{"node":"10.* || >= 12"},"volta":{"node":"12.19.0","yarn":"1.22.10"},"gitHead":"dcb159577a6eb60c1fc8b1490c1ba22376f17cc9","bugs":{"url":"https://github.com/stefanpenner/resolve-package-path/issues"},"homepage":"https://github.com/stefanpenner/resolve-package-path#readme","_id":"resolve-package-path@3.0.1","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-IsMa7xljkYdj+oF4vdxjiaZ0E2itynPaF7/5sY8keuO00vL9lsA5FRjy1+e2khzxEl4WUJIQMDgmhkgZw9h8RQ==","shasum":"f6971030c2609cce413460b31775bd957010092f","tarball":"http://registry-npm.ywwl.com/resolve-package-path/download/resolve-package-path-3.0.1.tgz","fileCount":32,"unpackedSize":69904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhjd7CRA9TVsSAnZWagAAWL4P/02giMYpz2CIGBzu6SNA\nuMrmR90jY3txpJAWGTGSYaydf2XfngnCuuC+fy5PaBOsIyS9eb/5ndJ0UbLd\nOQqq6n9Fhq/a0tLrNzctBNHOgfuxK5CIoWsZCkTQEsFag9YB2xmy4m9fpXEV\nSEFCFZ+jtU6c7dMV3jjoxzgPjyPvqGHHAzvQ05ztxSA+xnGVYoWoHV8eF2fO\n0rOo/bNpizVhBnyBnMrT8G23mAxGaBg/kfHjNfZkF8fDa/00XzAOwwLTPLwt\nj3H/gQMhh5n2PgniKVOp+Ksx/6AsgLImOvZzUZ1xcpMPm2GDaTVf5g1usJI9\neDV/ym8DyOLJ8J6HzGA6FkFI5CRIOjLqNWZWHf0c1VKvh2ZINY3UHbJQcuH2\nDaTVqxfl5PsHEnvvQ0CviCeO0YwYkFoMOmgoGBk5ZT9lKqRwK50CBWf6foFH\nbY+nxlXxG5zsAArfsNrmA4ipWmyjuqgEurrFW2iwnE+iwdEUtL5uSD1b+HTs\npSvSGL0vmHO683seKxDj5Me6BEo6Pp6DuQ7kzEHfrO/XyLzMtq9phsJr8/Cb\n9ZcXTVrSAG6ES5T9e1+0iFfVpPdObb0wAO13ypNX3cwd4ecNXR/I91FizNbU\nzHpAt5NFxGWfRRaZhwndFQW6zJeYUA9mmMWc2tVECYfMoTVjGua09cpJH0AL\n3qtH\r\n=XQeG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPa902iLjhN416dFK5qGB4Pw6tDQqnbDbSfhI27GyZTwIhAMSK+eKQ6kTTLEXf/NYGQiWDGDV47VfLQVcZM8WY3iJu"}],"size":18271,"noattachment":false,"key":"/resolve-package-path/-/resolve-package-path-3.0.1.tgz"},"maintainers":[{"name":"rwjblue","email":"me@rwjblue.com"},{"name":"stefanpenner","email":"stefan.penner@gmail.com"}],"_npmUser":{"name":"stefanpenner","email":"stefan.penner@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-package-path_3.0.1_1602631546685_0.2290577953517161"},"_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":1602631547068,"_cnpm_publish_time":1602631547068,"dist-tags":{"latest":"4.0.3"}}