{"id":19219638,"url":"https://github.com/squirrel-forge/node-sass-package-importer","last_synced_at":"2026-05-15T12:09:06.829Z","repository":{"id":57162151,"uuid":"450936992","full_name":"squirrel-forge/node-sass-package-importer","owner":"squirrel-forge","description":"A simple node sass package importer built for the new sass js api.","archived":false,"fork":false,"pushed_at":"2022-10-31T23:39:36.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T06:57:22.113Z","etag":null,"topics":["importer","package-importer","plugin","sass"],"latest_commit_sha":null,"homepage":"","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/squirrel-forge.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}},"created_at":"2022-01-22T21:13:47.000Z","updated_at":"2022-01-23T00:05:23.000Z","dependencies_parsed_at":"2023-01-21T00:47:55.977Z","dependency_job_id":null,"html_url":"https://github.com/squirrel-forge/node-sass-package-importer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/squirrel-forge/node-sass-package-importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-sass-package-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-sass-package-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-sass-package-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-sass-package-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squirrel-forge","download_url":"https://codeload.github.com/squirrel-forge/node-sass-package-importer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-sass-package-importer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33066195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["importer","package-importer","plugin","sass"],"created_at":"2024-11-09T14:32:19.947Z","updated_at":"2026-05-15T12:09:06.809Z","avatar_url":"https://github.com/squirrel-forge.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @squirrel-forge/sass-package-importer\nA simple node sass package importer built for the new [sass js api](https://sass-lang.com/documentation/js-api) must be used with the new [sass](https://www.npmjs.com/package/sass) package.\nMade to be compatible with node ^10.0.0, might work on higher versions, but currently not supported or tested.\n\n---\n**Please note** that if you are looking for a more versatile implementation, especially if you are looking for the [old node-sass api](https://www.npmjs.com/package/node-sass) or the [sass legacy api](https://sass-lang.com/documentation/js-api#legacy-api), check out the [node-sass-package-importer](https://www.npmjs.com/package/node-sass-package-importer).\n\n## Installation\n\n```\nnpm i @squirrel-forge/sass-package-importer\n```\n\n## Usage\n\nUse *~* to prefix packages that should be imported or used and they will be resolved according to your [options](#options), the default options will attempt to load from the *node_modules* directory inside your cwd or you may set/add your own paths that should be used to resolve packages.\n\n#### Source scss\n```scss\n@import \"~@squirrel-forge/sass-util\";\n\n// OR\n@use \"~@squirrel-forge/sass-util\";\n```\n\nIt will also allow nested package paths if you wish to import or use a file nested inside a package and not import the complete package as following:\n\n```scss\n@import \"~@squirrel-forge/sass-util/src/mixins/index\";\n\n// OR\n@use \"~@squirrel-forge/sass-util/src/mixins/index\";\n```\n\n### Plugin usage:\n```javascript\nconst sass = require( 'sass' );\nconst packageImporter = require( '@squirrel-forge/sass-package-importer' );\n\n// Classic way, calling the factory in place with options\nconst sassOptions = { importers : [ packageImporter( /* null|PackageImporterOptions */ ) ] };\n\n// Plugin way, supply the sass options as second argument\n// It will create the importers property if required and append the importer.\nconst sassOptions = {};\npackageImporter( /* null|PackageImporterOptions */, sassOptions );\n\n// Since the importer is sync it work for both sync and async compile\nconst result = sass.compile( scssFilename, sassOptions );\n\n// OR\nconst result = await sass.compileAsync( scssFilename, sassOptions );\n```\n\n## Options\n\n```javascript\n/**\n * Package importer options\n * @type {null|PackageImporterOptions}\n */\nconst PACKAGE_IMPORTER_DEFAULT_OPTIONS = {\n    strict : false,\n    cwd : null,\n    prefix : '~',\n    ext : [ '.scss', '.sass', '.css' ],\n    keys : [ 'scss', 'sass', 'style', 'css', 'main.scss', 'main.sass', 'main.style', 'main.css', 'main' ],\n    paths : [ 'node_modules' ],\n};\n\n/**\n * @typedef {Object} PackageImporterOptions\n * @property {boolean} strict - Require a package directory and a package.json if there is no module target info, default: false\n * @property {null|string} cwd - Set the working directory for the importer, default: null \u003e process.cwd()\n * @property {string} prefix - Package import prefix, default: ~\n * @property {Array\u003cstring\u003e} ext - Array of acceptable extensions, defaults: see PACKAGE_IMPORTER_DEFAULT_OPTIONS.ext\n * @property {Array\u003cstring\u003e} keys - Array of possible package keys to check for a file reference, defaults: see PACKAGE_IMPORTER_DEFAULT_OPTIONS.keys\n * @property {Array\u003cstring\u003e} paths - Array of possible package locations, relative or absolute paths, defaults see PACKAGE_IMPORTER_DEFAULT_OPTIONS.paths\n */\n```\n\n## Issues\n\nIf you encounter any issues, please report [here](https://github.com/squirrel-forge/node-sass-package-importer/issues).\n\n---\nCheck the sourcecode on [github](https://github.com/squirrel-forge/node-sass-package-importer) for extensive comments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrel-forge%2Fnode-sass-package-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquirrel-forge%2Fnode-sass-package-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrel-forge%2Fnode-sass-package-importer/lists"}