{"_id":"resolve-dependency-path","_rev":"3318823","name":"resolve-dependency-path","description":"Convert a dependency path into a filepath","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"time":{"modified":"2024-06-11T09:02:26.000Z","created":"2014-11-28T18:39:12.415Z","4.0.0":"2024-04-10T06:20:14.370Z","3.0.2":"2023-05-07T18:18:10.085Z","3.0.1":"2023-05-07T11:38:57.180Z","3.0.0":"2023-05-06T11:55:24.541Z","2.0.0":"2018-12-21T15:32:28.932Z","1.0.2":"2015-02-28T22:08:45.577Z","1.0.1":"2014-11-28T18:39:12.415Z"},"users":{},"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-resolve-dependency-path.git"},"versions":{"4.0.0":{"name":"resolve-dependency-path","version":"4.0.0","description":"Convert a dependency path into a filepath","main":"index.js","scripts":{"lint":"xo","fix":"xo --fix","mocha":"mocha","test":"npm run lint && npm run mocha","test:ci":"c8 npm run mocha"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-resolve-dependency-path.git"},"keywords":["dependency","filepath","module"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-resolve-dependency-path/issues"},"homepage":"https://github.com/dependents/node-resolve-dependency-path","engines":{"node":">=18"},"devDependencies":{"c8":"^9.1.0","mocha":"^10.4.0","xo":"^0.58.0"},"xo":{"space":true,"ignores":["test/fixtures/*"],"rules":{"arrow-body-style":"off","capitalized-comments":"off","comma-dangle":["error","never"],"curly":["error","multi-line"],"operator-linebreak":["error","after"],"object-curly-spacing":["error","always"],"space-before-function-paren":["error","never"],"unicorn/prefer-module":"off","unicorn/prefer-node-protocol":"off","unicorn/prefer-string-slice":"off","unicorn/prefer-top-level-await":"off","unicorn/prevent-abbreviations":"off"}},"_id":"resolve-dependency-path@4.0.0","gitHead":"bfdc1f901da9a07004094790d141680be4b811ac","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"shasum":"ec0b2aa83ce8cd125c7db734a40b4809959bf688","size":2801,"noattachment":false,"key":"/resolve-dependency-path/-/resolve-dependency-path-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-dependency-path/download/resolve-dependency-path-4.0.0.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency-path_4.0.0_1712730014207_0.8904747451773627"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-04-10T06:20:14.370Z","publish_time":1712730014370,"_source_registry_name":"default","_cnpm_publish_time":1712730014370},"3.0.2":{"name":"resolve-dependency-path","version":"3.0.2","description":"Convert a dependency path into a filepath","main":"index.js","scripts":{"lint":"xo","fix":"xo --fix","mocha":"mocha","test":"npm run lint && npm run mocha","test:ci":"c8 npm run mocha"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-resolve-dependency-path.git"},"keywords":["dependency","filepath","module"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-resolve-dependency-path/issues"},"homepage":"https://github.com/dependents/node-resolve-dependency-path","engines":{"node":">=14"},"devDependencies":{"c8":"^7.13.0","mocha":"^10.2.0","xo":"^0.54.2"},"xo":{"space":true,"ignores":["test/fixtures/*"],"rules":{"arrow-body-style":"off","capitalized-comments":"off","comma-dangle":["error","never"],"curly":["error","multi-line"],"operator-linebreak":["error","after"],"object-curly-spacing":["error","always"],"space-before-function-paren":["error","never"],"unicorn/prefer-module":"off","unicorn/prefer-node-protocol":"off","unicorn/prefer-string-slice":"off","unicorn/prefer-top-level-await":"off","unicorn/prevent-abbreviations":"off"}},"gitHead":"afe4796e7542ca60634e05d346b348e0c3b08e15","_id":"resolve-dependency-path@3.0.2","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"shasum":"012816717bcbe8b846835da11af9d2beb5acef50","size":2782,"noattachment":false,"key":"/resolve-dependency-path/-/resolve-dependency-path-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-dependency-path/download/resolve-dependency-path-3.0.2.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency-path_3.0.2_1683483489926_0.9693837673365908"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-07T18:18:10.085Z","publish_time":1683483490085,"_source_registry_name":"default","_cnpm_publish_time":1683483490085},"3.0.1":{"name":"resolve-dependency-path","version":"3.0.1","description":"Convert a dependency path into a filepath","main":"index.js","scripts":{"lint":"xo","fix":"xo --fix","mocha":"mocha","test":"npm run lint && npm run mocha","test:ci":"c8 npm run mocha"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-resolve-dependency-path.git"},"keywords":["dependency","filepath","module"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-resolve-dependency-path/issues"},"homepage":"https://github.com/dependents/node-resolve-dependency-path","engines":{"node":">=14"},"devDependencies":{"c8":"^7.13.0","mocha":"^10.2.0","xo":"^0.54.2"},"xo":{"space":true,"ignores":["test/fixtures/*"],"rules":{"arrow-body-style":"off","capitalized-comments":"off","comma-dangle":["error","never"],"curly":["error","multi-line"],"max-nested-callbacks":["error",5],"operator-linebreak":["error","after"],"object-curly-spacing":["error","always"],"space-before-function-paren":["error","never"],"unicorn/prefer-module":"off","unicorn/prefer-node-protocol":"off","unicorn/prefer-string-slice":"off","unicorn/prefer-top-level-await":"off","unicorn/prevent-abbreviations":"off"}},"gitHead":"38270507b6544ef1207c7e3c92fab1f9e2770c58","_id":"resolve-dependency-path@3.0.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"shasum":"6401eddb2f30adf02fc2fe8e7f249f926e4e660e","size":2800,"noattachment":false,"key":"/resolve-dependency-path/-/resolve-dependency-path-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-dependency-path/download/resolve-dependency-path-3.0.1.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency-path_3.0.1_1683459537029_0.023356072240853232"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-07T11:38:57.180Z","publish_time":1683459537180,"_source_registry_name":"default","_cnpm_publish_time":1683459537180},"3.0.0":{"name":"resolve-dependency-path","version":"3.0.0","description":"Convert a dependency path into a filepath","main":"index.js","scripts":{"lint":"xo","fix":"xo --fix","mocha":"mocha","test":"npm run lint && npm run mocha","test:ci":"c8 npm run mocha"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-resolve-dependency-path.git"},"keywords":["dependency","filepath","module"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-resolve-dependency-path/issues"},"homepage":"https://github.com/dependents/node-resolve-dependency-path","engines":{"node":">=14"},"devDependencies":{"c8":"^7.13.0","mocha":"^10.2.0","xo":"^0.54.2"},"xo":{"space":true,"ignores":["test/fixtures/*"],"rules":{"arrow-body-style":"off","capitalized-comments":"off","comma-dangle":["error","never"],"curly":["error","multi-line"],"max-nested-callbacks":["error",5],"operator-linebreak":["error","after"],"object-curly-spacing":["error","always"],"space-before-function-paren":["error","never"],"unicorn/prefer-module":"off","unicorn/prefer-node-protocol":"off","unicorn/prefer-string-slice":"off","unicorn/prefer-top-level-await":"off","unicorn/prevent-abbreviations":"off"}},"gitHead":"d000c3aad1bc496a386b2aa8456be6b0cfb2a40e","_id":"resolve-dependency-path@3.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"shasum":"984c939dafc9731e15d2190faac35134bf891bd3","size":2832,"noattachment":false,"key":"/resolve-dependency-path/-/resolve-dependency-path-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-dependency-path/download/resolve-dependency-path-3.0.0.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency-path_3.0.0_1683374124405_0.1452123650715984"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-06T11:55:24.541Z","publish_time":1683374124541,"_source_registry_name":"default","_cnpm_publish_time":1683374124541},"2.0.0":{"name":"resolve-dependency-path","version":"2.0.0","description":"Convert a dependency path into a filepath","main":"index.js","directories":{"test":"test"},"scripts":{"test":"jscs -p google index.js test/test.js && mocha test/test.js"},"engines":{"node":">=6.0.0"},"repository":{"type":"git","url":"git+https://github.com/mrjoelkemp/node-resolve-dependency-path.git"},"keywords":["dependency","filepath","module"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com","url":"http://www.mrjoelkemp.com/"},"license":"MIT","bugs":{"url":"https://github.com/mrjoelkemp/node-resolve-dependency-path/issues"},"homepage":"https://github.com/mrjoelkemp/node-resolve-dependency-path","devDependencies":{"jscs":"^3.0.7","jscs-preset-mrjoelkemp":"^2.0.0","mocha":"~2.0.1"},"gitHead":"6d668d15f620c33c7d29963d626988b9cbc767dc","_id":"resolve-dependency-path@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},"dist":{"shasum":"11700e340717b865d216c66cabeb4a2a3c696736","size":2559,"noattachment":false,"key":"/resolve-dependency-path/-/resolve-dependency-path-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-dependency-path/download/resolve-dependency-path-2.0.0.tgz"},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency-path_2.0.0_1545406348816_0.856459948464519"},"_hasShrinkwrap":false,"publish_time":1545406348932,"_cnpm_publish_time":1545406348932},"1.0.2":{"name":"resolve-dependency-path","version":"1.0.2","description":"Convert a dependency path into a filepath","main":"index.js","directories":{"test":"test"},"scripts":{"test":"jscs -p google index.js test/test.js && mocha test/test.js"},"repository":{"type":"git","url":"https://github.com/mrjoelkemp/node-resolve-dependency-path.git"},"keywords":["dependency","filepath","module"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com","url":"http://www.mrjoelkemp.com/"},"license":"MIT","bugs":{"url":"https://github.com/mrjoelkemp/node-resolve-dependency-path/issues"},"homepage":"https://github.com/mrjoelkemp/node-resolve-dependency-path","devDependencies":{"jscs":"~1.8.0","mocha":"~2.0.1"},"gitHead":"9d2e47f416f48600f5545cbd0e0fbf188e1a584b","_id":"resolve-dependency-path@1.0.2","_shasum":"6abe93a6de3e4f9dce7b5e8261e1f47aa1af4dc2","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"dist":{"shasum":"6abe93a6de3e4f9dce7b5e8261e1f47aa1af4dc2","size":2411,"noattachment":false,"key":"/resolve-dependency-path/-/resolve-dependency-path-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-dependency-path/download/resolve-dependency-path-1.0.2.tgz"},"publish_time":1425161325577,"_cnpm_publish_time":1425161325577,"_hasShrinkwrap":false},"1.0.1":{"name":"resolve-dependency-path","version":"1.0.1","description":"Convert a dependency path into a filepath","main":"index.js","directories":{"test":"test"},"scripts":{"test":"jscs -p google index.js test/test.js && mocha test/test.js"},"repository":{"type":"git","url":"https://github.com/mrjoelkemp/node-resolve-dependency-path.git"},"keywords":["dependency","filepath","module"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com","url":"http://www.mrjoelkemp.com/"},"license":"MIT","bugs":{"url":"https://github.com/mrjoelkemp/node-resolve-dependency-path/issues"},"homepage":"https://github.com/mrjoelkemp/node-resolve-dependency-path","devDependencies":{"jscs":"~1.8.0","mocha":"~2.0.1"},"gitHead":"3c7c5d30e6610c1a43c3bcbe765b1f9a03580c00","_id":"resolve-dependency-path@1.0.1","_shasum":"e0038e72d33b9a026b911fc88493a33be2dafb02","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"dist":{"shasum":"e0038e72d33b9a026b911fc88493a33be2dafb02","size":1811,"noattachment":false,"key":"/resolve-dependency-path/-/resolve-dependency-path-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve-dependency-path/download/resolve-dependency-path-1.0.1.tgz"},"publish_time":1417199952415,"_cnpm_publish_time":1417199952415,"_hasShrinkwrap":false}},"readme":"# resolve-dependency-path\n\n[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-resolve-dependency-path/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-resolve-dependency-path/actions/workflows/ci.yml?query=branch%3Amain)\n[![npm version](https://img.shields.io/npm/v/resolve-dependency-path?logo=npm&logoColor=fff)](https://www.npmjs.com/package/resolve-dependency-path)\n[![npm downloads](https://img.shields.io/npm/dm/resolve-dependency-path)](https://www.npmjs.com/package/resolve-dependency-path)\n\n> Convert a dependency path into a filepath\n\n```sh\nnpm install resolve-dependency-path\n```\n\n## Usage\n\n```js\nconst resolvePath = require('resolve-dependency-path');\n\nconst resolved = resolvePath({\n  dependency: './foobar',\n  filename: 'path/to/file/containing/dependency.js',\n  directory: 'path/to/all/files'\n});\n```\n\n* `dependency`: the actual dependency path (probably extracted from a `require()`)\n* `filename`: the file that required this dependency (likely the file whose dependencies are being extracted)\n* `directory`: the root of all modules being processed. Dependencies are often about this root unless they're relative.\n\n## Example\n\nIf you have a file like:\n\n*myapp/foo.js*\n\n```js\nvar require('./bar');\n```\n\nThen if you want to open the file associated with the dependency, you need to resolve `./bar` onto the filesystem.\n\nSince `./bar` is a relative path, it should be resolved relative to `foo.js`,\nmore specifically the directory containing `foo.js`, `myapp/`. This resolution would yield\n`myapp/bar.js`.\n\nThis is why the `filename` attribute is required to use this library.\n\nIf you have a non-relative dependency path like:\n\n*myapp/foo.js*\n\n```js\ndefine([\n  'bar'\n], function(bar) {\n\n});\n```\n\nThen `bar` is relative to the root of all files, `myapp`. The resolution would yield\n`myapp/bar.js`.\n\nA more complex example with subdirectories:\n\n*myapp/feature1/foo.js*\n\n```js\ndefine([\n  'feature2/bar'\n], function(bar) {\n\n});\n```\n\nThe dependency `feature2/bar` is relative to the root of all files, `myapp`, *not* the file `foo.js`.\n\nThis is why the `directory` attribute is required to use this library.\n\n## License\n\n[MIT](LICENSE)\n","_attachments":{},"homepage":"https://github.com/dependents/node-resolve-dependency-path","bugs":{"url":"https://github.com/dependents/node-resolve-dependency-path/issues"},"license":"MIT"}