{
  "_id": "@csstools/sass-import-resolve",
  "maintainers": [
    {
      "email": "romainmenke@gmail.com",
      "name": "romainmenke"
    },
    {
      "email": "sombragriselros@gmail.com",
      "name": "alaguna"
    },
    {
      "email": "jonathantneal@hotmail.com",
      "name": "jonathantneal"
    }
  ],
  "keywords": [
    "sass",
    "spec",
    "imports",
    "resolve",
    "algorithm",
    "external",
    "files",
    "style",
    "sheets"
  ],
  "dist-tags": {
    "latest": "1.0.0"
  },
  "author": {
    "name": "Jonathan Neal",
    "email": "jonathantneal@hotmail.com"
  },
  "_rev": "4-0f624aadd1334996f1487da8aef555f5",
  "description": "An algorithm for resolving imports in Sass",
  "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",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jonathantneal/sass-import-resolve.git"
  },
  "bugs": {
    "url": "https://github.com/jonathantneal/sass-import-resolve/issues"
  },
  "license": "CC0-1.0",
  "versions": {
    "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": {
        "integrity": "sha512-xqOW7bR2Nok5cGSvcVZPkHuSzJxMZdr92NPTmvWzYeG1RcRFmoMSGdGGI1Ts0/4pLlfKtAUsDd9M/f+EDTSIYw==",
        "shasum": "f0942ba5202e2d807a39242dc23e86854f29625e",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@csstools/sass-import-resolve/-/sass-import-resolve-0.0.0.tgz",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIHpvjZPuv8GNURBpjHuXj8P8Dpb85Z6xyACHg/HSymHNAiBqtM7pfeWUhTuPllQzIW+HsHrO+ZxgSyjLiF36Xx0jpQ=="
          }
        ]
      },
      "maintainers": [
        {
          "name": "jonathantneal",
          "email": "jonathantneal@hotmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/sass-import-resolve-0.0.0.tgz_1512576023143_0.7252501812763512"
      },
      "directories": {}
    },
    "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": {
        "integrity": "sha512-pH4KCsbtBLLe7eqUrw8brcuFO8IZlN36JjdKlOublibVdAIPHCzEnpBWOVUXK5sCf+DpBi8ZtuWtjF0srybdeA==",
        "shasum": "32c3cdb2f7af3cd8f0dca357b592e7271f3831b5",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@csstools/sass-import-resolve/-/sass-import-resolve-1.0.0.tgz",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQCI4rR8eLXfbil5BEEbeV6C+5AlR/M4Fg8YLy9kDEPuLQIgfYe/SO3V5jClduo9CQlF8YNJq4EoR4jS9rdPWKne96Y="
          }
        ]
      },
      "maintainers": [
        {
          "name": "jonathantneal",
          "email": "jonathantneal@hotmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/sass-import-resolve-1.0.0.tgz_1512577346579_0.5032235027756542"
      },
      "directories": {}
    }
  },
  "name": "@csstools/sass-import-resolve",
  "time": {
    "modified": "2026-07-28T09:51:36.775Z",
    "created": "2017-12-06T16:00:23.208Z",
    "0.0.0": "2017-12-06T16:00:23.208Z",
    "1.0.0": "2017-12-06T16:22:26.648Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/jonathantneal/sass-import-resolve#readme"
}