{"id":15041742,"url":"https://github.com/joneff/sass-import-resolver","last_synced_at":"2026-02-14T07:31:15.213Z","repository":{"id":35137413,"uuid":"211571081","full_name":"joneff/sass-import-resolver","owner":"joneff","description":"Resolves the path of sass imports, following a heavily opinionated and probably very shady algorithm","archived":false,"fork":false,"pushed_at":"2023-03-01T22:17:37.000Z","size":524,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-10-06T12:55:55.078Z","etag":null,"topics":["sass","sass-importer","sass-resolver"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joneff.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-28T22:55:13.000Z","updated_at":"2022-02-11T16:19:05.000Z","dependencies_parsed_at":"2024-09-20T18:22:50.307Z","dependency_job_id":null,"html_url":"https://github.com/joneff/sass-import-resolver","commit_stats":{"total_commits":39,"total_committers":4,"mean_commits":9.75,"dds":0.4871794871794872,"last_synced_commit":"bb8ea68dc2828d58db8e190bb093f09b952a3cfc"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/joneff/sass-import-resolver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneff%2Fsass-import-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneff%2Fsass-import-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneff%2Fsass-import-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneff%2Fsass-import-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joneff","download_url":"https://codeload.github.com/joneff/sass-import-resolver/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joneff%2Fsass-import-resolver/sbom","scorecard":{"id":530789,"data":{"date":"2025-08-11","repo":{"name":"github.com/joneff/sass-import-resolver","commit":"bb8ea68dc2828d58db8e190bb093f09b952a3cfc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci_unit.yml:1","Warn: no topLevel permission defined: .github/workflows/merge_develop.yml:1","Warn: no topLevel permission defined: .github/workflows/release_stable.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci_unit.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/joneff/sass-import-resolver/ci_unit.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci_unit.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/joneff/sass-import-resolver/ci_unit.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/merge_develop.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/joneff/sass-import-resolver/merge_develop.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_stable.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/joneff/sass-import-resolver/release_stable.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_stable.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/joneff/sass-import-resolver/release_stable.yml/develop?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/joneff/sass-import-resolver/releases/20330230","Warn: release artifact v0.1.2 not signed: https://api.github.com/repos/joneff/sass-import-resolver/releases/20330242","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/joneff/sass-import-resolver/releases/20330230","Warn: release artifact v0.1.2 does not have provenance: https://api.github.com/repos/joneff/sass-import-resolver/releases/20330242"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"18 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T05:41:09.004Z","repository_id":35137413,"created_at":"2025-08-20T05:41:09.004Z","updated_at":"2025-08-20T05:41:09.004Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29439486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T07:24:13.446Z","status":"ssl_error","status_checked_at":"2026-02-14T07:23:58.969Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sass","sass-importer","sass-resolver"],"created_at":"2024-09-24T20:46:25.961Z","updated_at":"2026-02-14T07:31:15.194Z","avatar_url":"https://github.com/joneff.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sass-import-resolver\n\n[sass-import-resolver] resolves the path of sass imports, following a heavily opinionated and probably very shady algorithm, which I will get to in a bit.\n\n## Purpose\n\nThe purpose of the package is to be used for [sass importers] or similar scripts. The [API](#API) has similar signature to a sass importer.\n\n## Installation\n\n```shell\nnpm install @joneff/sass-import-resolver --save-dev\n```\n\n## Basic Usage\n\n\u003e It's probably not a good idea to use in any production code, without rigorous testing. Usage may feel a bit like a [Kübler-Ross] [grief cycle] -- denial, anger, barganing, depression, acceptance -- but it's the only sane solution I was able to come up with.\n\u003e\n\u003e -- me\n\nSomething like this will yield results:\n\n```javascript\nconst resolver = require('@joneff/sass-import-resolver');\n\n// assuming @import \"../some/dependency.scss\" in ./my/overly/nested/framework.scss\nconst file = ...;\nconst options = ...;\n\nconst result = resolver.resolve({ file, ...options });\n\nconsole.log(result);\n// if the file exists =\u003e ./my/overly/some/dependecy.scss\n// if not =\u003e ../some/dependency.scss\n```\n\n## API\n\nThe api has only two methods with both using the same params.\n\n### resolve()\n\n* Signature: `function resolve( options: { file: String, prev?: String, includePaths?: Array\u003cString\u003e, nodeModules?: String } ) : String`\n\nJust a facade -- passes everything down to `_resove` and waits for results.\n\n### _resolve()\n\n* Signature: `function _resolve( options: { file: String, prev?: String, includePaths?: Array\u003cString\u003e, nodeModules?: String } ) : Array\u003cString\u003e`\n\nDoes the actual work, collects **unique** matches and returns them.\n\n### options\n\n* `options.file` -- Path to a file\n* `options.prev` (Optional) -- Path to file (or dir) to be used for resolving `url`. Ideally, it should not be empty and should be the previously resolved path.\n* `options.includePaths` (Optional) -- An array of paths that the script can look in when attempting to resolve `@import` declarations. When resolving node_module (`~`), absolute (`/`) or parent (`../`) imports, this has no effect.\n* `options.nodeModules` (Optional) -- Location of `node_modules` when resolving. Defaults to `./node_modules`.\n\n## Heavily Opinionated and Probably Very Shady Algorithm\n\nThe algorithm is based on [Sass `@import` documentation], and should work as follows, assuming atleast `options.file` param is passed:\n\n1) if `file` starts with `http://`, `https://`, `//`, `\\\\\\\\` or `url(`, it's not proccessed at all and returned as is;\n2) if `prev` is file, set `cwd` to the directory that file is in;\n3) if `prev` is directory, set `cwd` to that directory;\n4) if `prev` is not passed, set `cwd` to `proccess.cwd()`;\n5) if `includePaths` is not passed, assume it's an empty array;\n6) if `file` is absolute path, clear `cwd` and `includePaths`;\n7) if `file` starts with `~`, assume node_modules import, set `cwd` to `node_modules` and clear `includePaths`;\n8) if `file` starts with `.`, clear `includePaths`;\n9) assuming there are any `includePaths` left, unique them with `cwd` and loop them:\n    1) if the file portion of `file` has `.css`, `.scss`, or `.sass` extension, resolve tha path and return it;\n    2) if the file portion `file` starts with `_`, resolve and return the following 7 variants in that order:\n        1) `_file.css`\n        2) `_file.scss`\n        3) `_file.sass`\n        4) `file/index.scss` (that's an exception from sass @import)\n        5) `file/index.sass`  (that's an exception from sass @import)\n        6) `file/_index.scss`\n        7) `file/_index.sass`\n    3) resolve and return the following 9 variants in that order:\n        1) `file.css`\n        2) `file.scss`\n        3) `file.sass`\n        4) `_file.scss`\n        5) `_file.sass`\n        6) `file/index.scss` (that's an exception from sass @import)\n        7) `file/index.sass`  (that's an exception from sass @import)\n        8) `file/_index.scss`\n        9) `file/_index.sass`\n10) assuming there is an array of matches, loop over:\n    1) return the resolved path of the first file that exists on the file system\n    2) otherwise return the original `file`\n\nSurely, the algorithm can be extended in various directions like scraping the `package.json` of resolved modules and looking for entry points, which is not a bad idea at all. However, if you are a sass package creator and you rely on such custom logic, things will not go well for consumers of said packages.\n\n## Contributing?\n\nSure.\n\n[sass-import-resolver]: https://github.com/joneff/sass-import-resolver\n[sass importers]: https://github.com/sass/node-sass#importer--v200---experimental\n[Kübler-Ross]: https://en.wikipedia.org/wiki/Elisabeth_K%C3%BCbler-Ross\n[grief cycle]: https://en.wikipedia.org/wiki/K%C3%BCbler-Ross_model\n[Sass `@import` documentation]: https://sass-lang.com/documentation/at-rules/import\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoneff%2Fsass-import-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoneff%2Fsass-import-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoneff%2Fsass-import-resolver/lists"}