{"_id":"@csstools/sass-import-resolve","_rev":"322609","name":"@csstools/sass-import-resolve","description":"An algorithm for resolving imports in Sass","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"time":{"modified":"2021-06-04T01:29:09.000Z","created":"2017-12-06T16:00:23.208Z","1.0.0":"2017-12-06T16:22:26.648Z","0.0.0":"2017-12-06T16:00:23.208Z"},"users":{},"author":{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"},"repository":{"type":"git","url":"git+https://github.com/jonathantneal/sass-import-resolve.git"},"versions":{"1.0.0":{"name":"@csstools/sass-import-resolve","version":"1.0.0","description":"An algorithm for resolving imports in Sass","author":{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"},"license":"CC0-1.0","repository":{"type":"git","url":"git+https://github.com/jonathantneal/sass-import-resolve.git"},"homepage":"https://github.com/jonathantneal/sass-import-resolve#readme","bugs":{"url":"https://github.com/jonathantneal/sass-import-resolve/issues"},"main":"index.js","module":"index.mjs","files":["index.mjs","index.js"],"scripts":{"prepublishOnly":"npm start","start":"babel index.mjs --presets=env --plugins=add-module-exports --out-file index.js","test":"npm start && npm run test:lint && npm run test:tape","test:lint":"eslint index.mjs --cache --ignore-pattern .gitignore","test:tape":"node .tape"},"engines":{"node":">=4.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-plugin-add-module-exports":"^0.2.1","babel-preset-env":"^1.6.1","eslint":"^4.12.1","eslint-config-dev":"^2.0.0"},"eslintConfig":{"extends":"dev","rules":{"consistent-return":0,"max-params":0,"no-param-reassign":0}},"keywords":["sass","spec","imports","resolve","algorithm","external","files","style","sheets"],"gitHead":"ba33e8f379dc3e8f0304ec656c63c645ee33ecb5","_id":"@csstools/sass-import-resolve@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},"dist":{"shasum":"32c3cdb2f7af3cd8f0dca357b592e7271f3831b5","size":5580,"noattachment":false,"key":"/@csstools/sass-import-resolve/-/@csstools/sass-import-resolve-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@csstools/sass-import-resolve/download/@csstools/sass-import-resolve-1.0.0.tgz"},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sass-import-resolve-1.0.0.tgz_1512577346579_0.5032235027756542"},"directories":{},"publish_time":1512577346648,"_hasShrinkwrap":false,"_cnpm_publish_time":1512577346648},"0.0.0":{"name":"@csstools/sass-import-resolve","version":"0.0.0","description":"An algorithm for resolving imports in Sass","author":{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"},"license":"CC0-1.0","repository":{"type":"git","url":"git+https://github.com/jonathantneal/sass-import-resolve.git"},"homepage":"https://github.com/jonathantneal/sass-import-resolve#readme","bugs":{"url":"https://github.com/jonathantneal/sass-import-resolve/issues"},"main":"index.js","module":"index.mjs","files":["index.mjs","index.js"],"scripts":{"prepublishOnly":"npm start","start":"babel index.mjs --presets=env --plugins=add-module-exports --out-file index.js","test":"npm start && npm run test:lint && npm run test:tape","test:lint":"eslint index.mjs --cache --ignore-pattern .gitignore","test:tape":"node .tape"},"engines":{"node":">=4.0.0"},"devDependencies":{"babel-cli":"^6.26.0","babel-plugin-add-module-exports":"^0.2.1","babel-preset-env":"^1.6.1","eslint":"^4.12.1","eslint-config-dev":"^2.0.0"},"eslintConfig":{"extends":"dev","rules":{"consistent-return":0,"max-params":0,"no-param-reassign":0}},"keywords":["sass","spec","imports","resolve","algorithm","external","files","style","sheets"],"gitHead":"93e657a7ce669a86384a5fe7b576d26b37c84985","_id":"@csstools/sass-import-resolve@0.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},"dist":{"shasum":"f0942ba5202e2d807a39242dc23e86854f29625e","size":5591,"noattachment":false,"key":"/@csstools/sass-import-resolve/-/@csstools/sass-import-resolve-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@csstools/sass-import-resolve/download/@csstools/sass-import-resolve-0.0.0.tgz"},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sass-import-resolve-0.0.0.tgz_1512576023143_0.7252501812763512"},"directories":{},"publish_time":1512576023208,"_hasShrinkwrap":false,"_cnpm_publish_time":1512576023208}},"readme":"# Sass Import Resolve [<img src=\"https://jonathantneal.github.io/sass-import-resolve/sass-logo.svg\" alt=\"Sass Logo\" width=\"90\" height=\"90\" align=\"right\">][Sass Import Resolve]\n\n[![NPM Version][npm-img]][npm-url]\n[![Linux Build Status][cli-img]][cli-url]\n[![Windows Build Status][win-img]][win-url]\n[![Gitter Chat][git-img]][git-url]\n\n[Sass Import Resolve] resolves the path and contents of Sass imports, following\nthe [Sass Import Resolve Specification].\n\n```sh\nnpm install @csstools/sass-import-resolve\n```\n\n## The Resolve Method\n\nThe `resolve` method takes any path and returns its absolute path, as\nresolved by the [Sass Import Resolve Specification].\n\n```js\nimport resolve from '@csstools/sass-import-resolve';\n\nconst { file } = resolve('path/to/sass-file');\n```\n\nThe `resolve` method may also return the contents of the resolved file.\n\n```js\nconst { file, contents } = resolve('path/to/sass-file', {\n  readFile: true\n});\n```\n\nThe `resolve` method may also resolve the path from a specific directory.\n\n```js\nconst { file } = resolve('sass-file', {\n  cwd: 'path/to'\n});\n```\n\nThe `resolve` method may also share its resolved cache.\n\n```js\nconst sharedCache = {};\n\nconst { file } = resolve('path/to/sass-file', {\n  cache: sharedCache\n});\n\n/* sharedCache {\n  \"/absolute/path/to/sass-file\": Promise {\n    file,\n    contents (when `readFile` is true)\n  }\n} */\n```\n\n## The Resolve Algorithm\n\nWhen `@import` is called, the following high-level algorithm is used to resolve\nthe location of a file within `url(id)` from `cwd`:\n\n1. if `id` begins with `/`\n   1. `cwd` is the filesystem root\n2. `file` is `cwd/id`\n3. `base` is base path of `file`\n4. `dir` is directory path of `file`\n5. if `base` ends with `.sass`, `.scss`, or `.css`\n   1. test whether `file` exists\n   2. if `base` does not start with `_`\n      1. test whether `dir/_base` exists\n6. otherwise\n   1. test whether `dir/base.scss` exists\n   2. test whether `dir/base.sass` exists\n   3. test whether `dir/base.css` exists\n   4. if `base` does not start with `_`\n      1. test whether `dir/_base.scss` exists\n      2. test whether `dir/_base.sass` exists\n      3. test whether `dir/_base.css` exists\n6. if the length of existing files is `1`\n   1. return the existing file\n7. otherwise, if the length of existing files is greater than `1`\n   1. throw `\"It's not clear which file to import\"`\n8. otherwise, if `base` does not end with `.css`\n   1. throw `\"File to import not found or unreadable\"`\n\nSee the [Sass Import Resolve Specification] for more details.\n\n[Sass Import Resolve]: https://github.com/jonathantneal/sass-import-resolve\n[Sass Import Resolve Specification]: https://jonathantneal.github.io/sass-import-resolve\n\n[cli-url]: https://travis-ci.org/jonathantneal/sass-import-resolve\n[cli-img]: https://img.shields.io/travis/jonathantneal/sass-import-resolve.svg\n[git-url]: https://gitter.im/postcss/postcss\n[git-img]: https://img.shields.io/badge/chat-gitter-blue.svg\n[npm-url]: https://www.npmjs.com/package/@csstools/sass-import-resolve\n[npm-img]: https://img.shields.io/npm/v/@csstools/sass-import-resolve.svg\n[win-url]: https://ci.appveyor.com/project/jonathantneal/sass-import-resolve\n[win-img]: https://img.shields.io/appveyor/ci/jonathantneal/sass-import-resolve.svg\n","_attachments":{},"homepage":"https://github.com/jonathantneal/sass-import-resolve#readme","bugs":{"url":"https://github.com/jonathantneal/sass-import-resolve/issues"},"license":"CC0-1.0"}