{"name":"stylus-lookup","version":"7.0.0","description":"Get the file associated with an imported/required Stylus partial","type":"module","exports":{".":"./index.js"},"bin":{"stylus-lookup":"bin/cli.js"},"scripts":{"lint":"xo","fix":"xo --fix","uvu":"uvu test","test":"npm run lint && npm run uvu","test:ci":"c8 npm run uvu"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-stylus-lookup.git"},"keywords":["stylus","lookup","dependency","partial"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-stylus-lookup/issues"},"homepage":"https://github.com/dependents/node-stylus-lookup","engines":{"node":">=20.19.0 || >=22.12.0"},"dependencies":{"commander":"^14.0.3"},"devDependencies":{"c8":"^11.0.0","uvu":"^0.5.6","xo":"^2.0.2"},"gitHead":"840e8e58de715f51fad2ee5871468f5808115f0a","_id":"stylus-lookup@7.0.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-zMnYWfTe3Ap2CxLuCNtdUgxSEg8AbKr6e7mPCpU+e8uIfi+GPMP7lU3AcVqnqoXFXyNPdd/seiFFH0GRTQpsmA==","shasum":"57fae8ddd54fb2726cbb4c1ed32588ba2078da83","tarball":"http://registry-npm.ywwl.com/stylus-lookup/download/stylus-lookup-7.0.0.tgz","fileCount":5,"unpackedSize":7662,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCPpvUw9JjYB3wKc117/l9rIF5F7tCX9+oCA0fbOvEDQgIhAN4CkaOZX7xeP6rJq0JuXMBB6I1hYOVrBThiKvbxqfIu"}],"size":3196,"noattachment":false,"key":"/stylus-lookup/-/stylus-lookup-7.0.0.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/stylus-lookup_7.0.0_1779194319422_0.4267418767466278"},"_hasShrinkwrap":false,"readme":"# stylus-lookup\n\n[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-stylus-lookup/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-stylus-lookup/actions/workflows/ci.yml?query=branch%3Amain)\n[![npm version](https://img.shields.io/npm/v/stylus-lookup?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylus-lookup)\n[![npm downloads](https://img.shields.io/npm/dm/stylus-lookup)](https://www.npmjs.com/package/stylus-lookup)\n\n> Get the file associated with a Stylus import\n\nThis module replaces the Stylus compiler's lookup algorithm for resolving a partial's path.\n\n* Handles same directory lookups, partials with or without extensions, partials within subdirectories,\npartials with the `.styl` or `.css` in the name, partials using the `index.styl` resolution.\n* **Does not** currently support glob imports or the use of additional paths. PRs welcome.\n\n*Originally built for [Dependents](https://github.com/dependents/Dependents)*\n\n## Usage\n\nESM:\n\n```js\nimport stylusLookup from 'stylus-lookup';\n\nstylusLookup({\n  dependency: 'foo',\n  filename: 'path/to/file',\n  directory: 'path/to/all/files'\n});\n```\n\nCJS:\n\n```js\nconst { default: stylusLookup } = require('stylus-lookup');\n\nstylusLookup({\n  dependency: 'foo',\n  filename: 'path/to/file',\n  directory: 'path/to/all/files'\n});\n```\n\n* `dependency`: The partial's name\n  * If your stylus file had `@import foo`, then `foo` would be the dependency name\n* `filename`: The file importing the dependency\n* `directory`: The location of all stylus files\n\nExample:\n\n```js\nimport stylusLookup from 'stylus-lookup';\n\nstylusLookup({\n  dependency: 'variables',\n  filename: 'app/styles/styles.styl',\n  directory: 'app/styles'\n}); // yields app/styles/variables.styl\n```\n\n* This assumes that the file `app/styles/styles.styl` has `@import variables` or `@require variables`\nand that all of the other stylus files are located within `app/styles`.\n\n## CLI\n\nAssumes a global install of `stylus-lookup` with `npm install -g stylus-lookup`\n\n```sh\nstylus-lookup [options] <dependency>\n```\n\n| Option | Description |\n|---|---|\n| `-f, --filename <path>` | File containing the import/require |\n| `-d, --directory <path>` | Root location of all Stylus files |\n\nExample:\n\n```sh\nstylus-lookup --filename app/styles/styles.styl --directory app/styles variables\n# yields app/styles/variables.styl\n```\n\nRun `stylus-lookup --help` to see all the options.\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1779194319589,"_cnpm_publish_time":1779194319589,"dist-tags":{"latest":"7.0.0"}}