{"_id":"resolve-dependency","_rev":"299998","name":"resolve-dependency","description":"Find The File That Dependency Path Resolves To.","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"zvr","email":""}],"time":{"modified":"2024-01-31T16:05:57.000Z","created":"2019-02-05T11:54:29.049Z","1.0.3":"2019-04-18T04:16:58.253Z","1.0.2":"2019-04-03T14:14:12.851Z","1.0.1":"2019-03-27T06:56:06.711Z","1.0.0":"2019-02-05T11:54:29.049Z"},"users":{},"author":{"name":"Anton","email":"anton@adc.sh"},"repository":{"type":"git","url":"git://github.com/artdecocode/resolve-dependency.git"},"versions":{"1.0.3":{"name":"resolve-dependency","version":"1.0.3","description":"Find The File That Dependency Path Resolves To.","main":"build/index.js","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec test/mask","spec":"yarn t test/spec","mask":"yarn t test/mask","test-build":"ALAMODE_ENV=test-build yarn test","lint":"eslint .","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -s","d":"yarn-s d1","d1":"NODE_DEBUG=doc doc src/index.js -g","build":"yarn-s d b doc","rec":"NODE_DEBUG=appshot appshot -T 23 -a Terminal -y 150 -f","e":"alanode","example/":"yarn e example/example.js"},"repository":{"type":"git","url":"git://github.com/artdecocode/resolve-dependency.git"},"keywords":["resolve-dependency","npm","dependency","path","modules","require","resolve","file"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/resolve-dependency/issues"},"homepage":"https://github.com/artdecocode/resolve-dependency#readme","devDependencies":{"alamode":"^1.9.3","documentary":"^1.23.4","eslint-config-artdeco":"1.0.1","yarn-s":"1.1.0","zoroaster":"^3.11.6"},"dependencies":{"@wrote/exists":"^1.0.3"},"licenseText":"MIT License\n\nCopyright (c) 2019 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"resolve-dependency@1.0.3","dist":{"shasum":"f0f78d0cea2c2fbf9dcf38b67ab15363aba8db34","size":3432,"noattachment":false,"key":"/resolve-dependency/-/resolve-dependency-1.0.3.tgz","tarball":"http://name.csiicloud.com:7001/resolve-dependency/download/resolve-dependency-1.0.3.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency_1.0.3_1555561018113_0.3919636058163729"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-19T19:20:00.023Z","publish_time":1555561018253,"_cnpm_publish_time":1555561018253},"1.0.2":{"name":"resolve-dependency","version":"1.0.2","description":"Find The File That Dependency Path Resolves To.","main":"build/index.js","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec test/mask","spec":"yarn t test/spec","mask":"yarn t test/mask","test-build":"ALAMODE_ENV=test-build yarn test","lint":"eslint .","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -s","d":"yarn-s d1","d1":"NODE_DEBUG=doc doc src/index.js -g","build":"yarn-s d b doc","rec":"NODE_DEBUG=appshot appshot -T 23 -a Terminal -y 150 -f","e":"alanode","example/":"yarn e example/example.js"},"repository":{"type":"git","url":"git://github.com/artdecocode/resolve-dependency.git"},"keywords":["resolve-dependency","npm","dependency","path","modules","require","resolve","file"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/resolve-dependency/issues"},"homepage":"https://github.com/artdecocode/resolve-dependency#readme","devDependencies":{"alamode":"1.9.0","documentary":"1.23.2","eslint-config-artdeco":"1.0.1","yarn-s":"1.1.0","zoroaster":"3.11.2"},"dependencies":{"@wrote/exists":"1.0.3"},"licenseText":"MIT License\n\nCopyright (c) 2019 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"resolve-dependency@1.0.2","dist":{"shasum":"b63cc30b257908f29b7ab48a8becbb2cd857204b","size":3392,"noattachment":false,"key":"/resolve-dependency/-/resolve-dependency-1.0.2.tgz","tarball":"http://name.csiicloud.com:7001/resolve-dependency/download/resolve-dependency-1.0.2.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency_1.0.2_1554300852641_0.667012407367098"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-19T19:19:59.131Z","publish_time":1554300852851,"_cnpm_publish_time":1554300852851},"1.0.1":{"name":"resolve-dependency","version":"1.0.1","description":"Find The File That Dependency Path Resolves To.","main":"build/index.js","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec test/mask","spec":"yarn t test/spec","mask":"yarn t test/mask","test-build":"ALAMODE_ENV=test-build yarn test","lint":"eslint .","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -s","d":"yarn-s d1","d1":"NODE_DEBUG=doc doc src/index.js -g","build":"yarn-s d b doc","rec":"NODE_DEBUG=appshot appshot -T 23 -a Terminal -y 150 -f","e":"node example","example/":"yarn e example/example.js"},"repository":{"type":"git","url":"git://github.com/artdecocode/resolve-dependency.git"},"keywords":["resolve-dependency","npm","dependency","path","modules","require","resolve","file"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/resolve-dependency/issues"},"homepage":"https://github.com/artdecocode/resolve-dependency#readme","devDependencies":{"alamode":"1.8.6","documentary":"1.22.0","eslint-config-artdeco":"1.0.1","yarn-s":"1.1.0","zoroaster":"3.11.1"},"dependencies":{"@wrote/exists":"1.0.1"},"licenseText":"MIT License\n\nCopyright (c) 2019 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"resolve-dependency@1.0.1","dist":{"shasum":"97c8e7dbea0a305a11fb740467fdc1613d76a3e5","size":3325,"noattachment":false,"key":"/resolve-dependency/-/resolve-dependency-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/resolve-dependency/download/resolve-dependency-1.0.1.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency_1.0.1_1553669766560_0.29303308891514535"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-19T19:19:58.272Z","publish_time":1553669766711,"_cnpm_publish_time":1553669766711},"1.0.0":{"name":"resolve-dependency","version":"1.0.0","description":"Find The File That Dependency Path Resolves To.","main":"build/index.js","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec test/mask","spec":"yarn t test/spec","mask":"yarn t test/mask","test-build":"ALAMODE_ENV=test-build yarn test","lint":"eslint .","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -s","d":"yarn-s d1","d1":"NODE_DEBUG=doc doc src/index.js -g","build":"yarn-s d b doc","rec":"NODE_DEBUG=appshot appshot -T 23 -a Terminal -y 150 -f","e":"node example","example/":"yarn e example/example.js"},"repository":{"type":"git","url":"git://github.com/artdecocode/resolve-dependency.git"},"keywords":["resolve-dependency","npm","dependency","path","modules","require","resolve","file"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/resolve-dependency/issues"},"homepage":"https://github.com/artdecocode/resolve-dependency#readme","devDependencies":{"alamode":"1.7.3","documentary":"1.21.1","eslint-config-artdeco":"1.0.1","yarn-s":"1.1.0","zoroaster":"3.6.6"},"dependencies":{"@wrote/exists":"1.0.1"},"licenseText":"MIT License\n\nCopyright (c) 2019 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"resolve-dependency@1.0.0","dist":{"shasum":"8f6b2dc6dce5e220eb6252581af4d1181d11dcc1","size":3113,"noattachment":false,"key":"/resolve-dependency/-/resolve-dependency-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/resolve-dependency/download/resolve-dependency-1.0.0.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve-dependency_1.0.0_1549367668918_0.8107467726887663"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-19T19:19:57.407Z","publish_time":1549367669049,"_cnpm_publish_time":1549367669049}},"readme":"# resolve-dependency\n\n[![npm version](https://badge.fury.io/js/resolve-dependency.svg)](https://npmjs.org/package/resolve-dependency)\n\n`resolve-dependency` Finds The File That Dependency Path Resolves To.\n\n```sh\nyarn add -E resolve-dependency\n```\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [API](#api)\n- [`async resolveDependency(path: string, relativeFrom?: string): { path: string, isDir: boolean }`](#async-resolvedependencypath-stringrelativefrom-string--path-string-isdir-boolean-)\n- [Copyright](#copyright)\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/0.svg?sanitize=true\"></a></p>\n\n## API\n\nThe package is available by importing its default function:\n\n```js\nimport resolveDependency from 'resolve-dependency'\n```\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/1.svg?sanitize=true\"></a></p>\n\n## `async resolveDependency(`<br/>&nbsp;&nbsp;`path: string,`<br/>&nbsp;&nbsp;`relativeFrom?: string,`<br/>`): { path: string, isDir: boolean }`\n\nFor the path that is used to require a module from another module, find the destination of the actual file on the file system. This includes the index JS and JSX files of directories. The second `relativeFrom` argument is used to point to the file in which the path is required from.\n\n```js\n/* yarn example/ */\nimport resolveDependency from 'resolve-dependency'\nimport { resolve } from 'path'\n\n(async () => {\n  // 1. Resolve index.js from directory\n  const res = await resolveDependency('./example/dir')\n  console.log(res)\n  // 2. Resolve index.jsx from directory\n  const res2 = await resolveDependency('./example/jsx')\n  console.log(res2)\n  // 3. Resolve file without extension\n  const res3 = await resolveDependency('./example/dir/index')\n  console.log(res3)\n  // 4. Resolve relative dependency\n  const res4 = await resolveDependency('./lib', 'example/jsx/index.js')\n  console.log(res4)\n  // 4. Resolve absolute dependency\n  const res5 = await resolveDependency(\n    './lib', resolve('example/jsx/index.js'))\n  console.log(res5)\n})()\n```\n```\n{ path: 'example/dir/index.js', isDir: true }\n{ path: 'example/jsx/index.jsx', isDir: true }\n{ path: 'example/dir/index.js', isDir: false }\n{ path: 'example/jsx/lib/index.js', isDir: true }\n{ path: '/Users/zavr/adc/resolve-dependency/example/jsx/lib/index.js',\n  isDir: true }\n```\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/2.svg?sanitize=true\"></a></p>\n\n## Copyright\n\n<table>\n  <tr>\n    <th>\n      <a href=\"https://artd.eco\">\n        <img src=\"https://raw.githubusercontent.com/wrote/wrote/master/images/artdeco.png\" alt=\"Art Deco\" />\n      </a>\n    </th>\n    <th>© <a href=\"https://artd.eco\">Art Deco</a>   2019</th>\n    <th>\n      <a href=\"https://www.technation.sucks\" title=\"Tech Nation Visa\">\n        <img src=\"https://raw.githubusercontent.com/artdecoweb/www.technation.sucks/master/anim.gif\"\n          alt=\"Tech Nation Visa\" />\n      </a>\n    </th>\n    <th><a href=\"https://www.technation.sucks\">Tech Nation Visa Sucks</a></th>\n  </tr>\n</table>\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/-1.svg?sanitize=true\"></a></p>","_attachments":{},"homepage":"https://github.com/artdecocode/resolve-dependency#readme","bugs":{"url":"https://github.com/artdecocode/resolve-dependency/issues"},"license":"MIT"}