{"name":"module-lookup-amd","version":"10.0.1","description":"Resolve aliased dependency paths using a RequireJS config","type":"module","exports":{".":"./index.js"},"bin":{"lookup-amd":"bin/cli.js"},"scripts":{"lint":"xo","fix":"xo --fix","vitest":"vitest","test":"npm run lint && vitest run","test:ci":"vitest run --coverage"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-module-lookup-amd.git"},"keywords":["amd","module","lookup","alias"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-module-lookup-amd/issues"},"homepage":"https://github.com/dependents/node-module-lookup-amd","engines":{"node":">=20.19.0 || >=22.12.0"},"dependencies":{"commander":"^14.0.3","requirejs":"^2.3.8","requirejs-config-file":"^4.0.0"},"devDependencies":{"@vitest/coverage-v8":"^4.1.7","vitest":"^4.1.7","xo":"^2.0.2"},"gitHead":"eaac1c5f3002197b6d21c4d1f9553f08494a6ba9","_id":"module-lookup-amd@10.0.1","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-F5f3yAzdUjsw4MJuTlq7wenvJ3jo3CtTLnVJ0n22VQ/v6jVGCxvKV6w/HZs3SYcEZttvPwvDCYiSgE8zJWGYzw==","shasum":"f1cfb1fc553fcb560d568f78f3186b5e461908cd","tarball":"http://registry-npm.ywwl.com/module-lookup-amd/download/module-lookup-amd-10.0.1.tgz","fileCount":5,"unpackedSize":11445,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEkceT2DVF0xFvwRldhfy00UGuwsHudwRkRFZy/qiRcCAiEA2HsbLKorlmhC1D0Z0sfKjkBvv4wbHSuBkL/JpD/Z28s="}],"size":4439,"noattachment":false,"key":"/module-lookup-amd/-/module-lookup-amd-10.0.1.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"mrjoelkemp","email":"mrjoelkemp@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/module-lookup-amd_10.0.1_1779773832488_0.03970127958298586"},"_hasShrinkwrap":false,"readme":"# module-lookup-amd\n\n[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-module-lookup-amd/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-module-lookup-amd/actions/workflows/ci.yml?query=branch%3Amain)\n[![npm version](https://img.shields.io/npm/v/module-lookup-amd?logo=npm&logoColor=fff)](https://www.npmjs.com/package/module-lookup-amd)\n[![npm downloads](https://img.shields.io/npm/dm/module-lookup-amd)](https://www.npmjs.com/package/module-lookup-amd)\n\n> Resolve AMD dependency paths to an absolute path on the filesystem\n\nThis module takes in a partial and *synchronously* gives back its absolute path on the filesystem.\n\nI built this for [Dependents'](https://packagecontrol.io/packages/Dependents) [jump to dependency](https://github.com/dependents/Dependents) feature that lets you click on a module name\nand open the relevant file.\n\n```sh\nnpm install module-lookup-amd\n```\n\n## Usage\n\n### ESM\n\n```js\nimport lookup from 'module-lookup-amd';\n\nconst realPath = lookup({\n  partial: 'someModule',\n  filename: 'file/containing/partial',\n  directory: 'path/to/all/js/files', // optional\n  config: 'path/to/my/requirejs/config', // optional\n  configPath: 'path/to/config/directory', // optional\n  fileSystem: {} // optional\n});\n```\n\n### CommonJS\n\n```js\nconst { default: lookup } = require('module-lookup-amd');\n```\n\n* `partial`: the dependency that you want to lookup\n* `filename`: the path of the file that contains the dependency (i.e., parent module)\n* `directory`: Used to resolve files if you're not using a requirejs config\n* `config`: the path to your RequireJS configuration file\n  * As an optimization, you can provide a pre-parsed config object (the contents of the RequireJS config in object form)\n  as `config`. You are then required to provide a `configPath` or `directory` argument which is assumed to be the location where your config would have been.\n* `configPath`: path to the config file (or its directory) used to determine the module resolution directory; inferred automatically when `config` is a string path\n* `fileSystem`: An alternative `fs` implementation to use for filesystem interactions. Defaults to Node.js's `fs` implementation if not supplied.\n\n## CLI\n\nAssumes a global `-g` installation\n\n```sh\nlookup-amd -c path/to/my/config.js -f path/to/file/containing/dependency -d path/containing/all/files my/dependency/name\n```\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1779773832639,"_cnpm_publish_time":1779773832639,"dist-tags":{"latest":"10.0.1"}}