{"id":13717431,"url":"https://github.com/adamlui/scss-to-css","last_synced_at":"2026-04-04T05:07:13.867Z","repository":{"id":233571919,"uuid":"787465040","full_name":"adamlui/scss-to-css","owner":"adamlui","description":"{ } Recursively compile all SCSS files into minified CSS.","archived":false,"fork":false,"pushed_at":"2026-01-27T19:59:53.000Z","size":2444,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-27T20:46:47.170Z","etag":null,"topics":["api","cli","compiler","css","javascript","minifier","nodejs","sass","scss","stylesheets","utilities"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamlui.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"adamlui","ko_fi":"adamlui"}},"created_at":"2024-04-16T15:16:04.000Z","updated_at":"2026-01-27T19:59:57.000Z","dependencies_parsed_at":"2025-12-12T10:07:39.653Z","dependency_job_id":null,"html_url":"https://github.com/adamlui/scss-to-css","commit_stats":null,"previous_names":["adamlui/scss-to-css"],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/adamlui/scss-to-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlui%2Fscss-to-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlui%2Fscss-to-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlui%2Fscss-to-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlui%2Fscss-to-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamlui","download_url":"https://codeload.github.com/adamlui/scss-to-css/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlui%2Fscss-to-css/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28909019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T06:42:00.998Z","status":"ssl_error","status_checked_at":"2026-01-30T06:41:58.659Z","response_time":66,"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":["api","cli","compiler","css","javascript","minifier","nodejs","sass","scss","stylesheets","utilities"],"created_at":"2024-08-03T00:01:22.106Z","updated_at":"2026-01-30T08:10:53.067Z","avatar_url":"https://github.com/adamlui.png","language":"JavaScript","funding_links":["https://github.com/sponsors/adamlui","https://ko-fi.com/adamlui"],"categories":["Frameworks / Resources"],"sub_categories":["S"],"readme":"\u003ca id=\"top\"\u003e\u003c/a\u003e\n\n\u003ctable align=\"center\"\u003e\n    \u003ctd align=\"center\" width=1000\u003e\n        \u003ch6\u003e\n            \u003cpicture\u003e\n                \u003csource type=\"image/svg+xml\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://assets.scsstocss.org/images/icons/earth/white/icon32.svg?v=7e4a141\"\u003e\n                \u003cimg height=14 src=\"https://assets.scsstocss.org/images/icons/earth/black/icon32.svg?v=7e4a141\"\u003e\n            \u003c/picture\u003e\n            \u0026nbsp;English |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/zh-cn#readme\"\u003e简体中文\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/zh-tw#readme\"\u003e繁體中文\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/ja#readme\"\u003e日本語\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/hi#readme\"\u003eहिंदी\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/bn#readme\"\u003eবাংলা\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/mr#readme\"\u003eमराठी\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/pa#readme\"\u003eਪੰਜਾਬੀ\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/de#readme\"\u003eDeutsch\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/es#readme\"\u003eEspañol\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/fr#readme\"\u003eFrançais\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/it#readme\"\u003eItaliano\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/nl#readme\"\u003eNederlands\u003c/a\u003e |\n            \u003ca href=\"https://github.com/adamlui/scss-to-css/tree/main/docs/pt#readme\"\u003ePortuguês\u003c/a\u003e\n        \u003c/h6\u003e\n    \u003c/td\u003e\n\u003c/table\u003e\n\n# { } scss-to-css\n\n### Recursively compile all SCSS files into minified CSS.\n\n\u003ca href=\"https://www.npmjs.com/package/@adamlui/scss-to-css\"\u003e\n    \u003cimg height=31 src=\"https://img.shields.io/npm/dm/%40adamlui%2Fscss-to-css?logo=npm\u0026color=af68ff\u0026logoColor=white\u0026labelColor=464646\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\u003ca href=\"#%EF%B8%8F-mit-license\"\u003e\n    \u003cimg height=31 src=\"https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive\u0026logoColor=white\u0026labelColor=464646\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/adamlui/js-utils/releases/tag/scss-to-css-2.0.1\"\u003e\n    \u003cimg height=31 src=\"https://img.shields.io/badge/Latest_Build-2.0.1-44cc11.svg?logo=icinga\u0026logoColor=white\u0026labelColor=464646\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/@adamlui/scss-to-css?activeTab=code\"\u003e\n    \u003cimg height=31 src=\"https://img.shields.io/npm/unpacked-size/%40adamlui%2Fscss-to-css?style=for-the-badge\u0026logo=ebox\u0026logoColor=white\u0026color=blue\u0026labelColor=464646\"\u003e\u003c/a\u003e\n\u003ca href=\"https://sonarcloud.io/component_measures?metric=new_vulnerabilities\u0026id=adamlui_scss-to-css:src/scss-to-css.js\"\u003e\n    \u003cimg height=31 src=\"https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_scss-to-css%3Asrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities\u0026query=%24.component.measures.0.value\u0026style=for-the-badge\u0026logo=sonarcloud\u0026logoColor=white\u0026labelColor=464646\u0026label=Vulnerabilities\u0026color=gold\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/toolleeo/cli-apps#conversion\"\u003e\n    \u003cimg height=31 src=\"https://img.shields.io/badge/Mentioned_in-Awesome-ff69b4?logo=awesomelists\u0026logoColor=white\u0026labelColor=464646\u0026style=for-the-badge\"\u003e\u003c/a\u003e\n\n\u003cimg height=6px width=\"100%\" src=\"https://assets.scsstocss.org/images/separators/aqua-gradient.png?v=7e4a141\"\u003e\n\n## ⚡ Installation\n\nAs a **global utility**:\n\n```\n$ npm install -g @adamlui/scss-to-css\n```\n\nAs a **dev dependency** (e.g. for build scripts), from your project root:\n\n```\n$ npm install -D @adamlui/scss-to-css\n```\n\nAs a **runtime dependency** (e.g. for on-the-fly compilation), from your project root:\n\n```\n$ npm install @adamlui/scss-to-css\n```\n\n\u003cbr\u003e\n\n\u003ca href=\"https://github.com/sponsors/adamlui\"\u003e\u003cimg src=\"https://assets.scsstocss.org/images/banners/sponsor/$10/banner1660x260.png?v=f3129dd\"\u003e\u003c/a\u003e\n\n\u003cimg height=6px width=\"100%\" src=\"https://assets.scsstocss.org/images/separators/aqua-gradient.png?v=7e4a141\"\u003e\n\n## 💻 Command line usage\n\nThe basic **global command** is:\n\n```\n$ scss-to-css\n```\n\nSample output:\n\n\u003cimg src=\"https://cdn.jsdelivr.net/gh/adamlui/scss-to-css@b74edea/node.js/media/images/screenshots/cli/scss-to-css-docs-cmd-output.png\"\u003e\n\n**📝 Note:** Source maps are also generated by default unless `-S` or `--no-source-maps` is passed.\n\n#\n\nTo specify **input/output** paths:\n   \n```\n$ scss-to-css [input_path] [output_path]\n```\n\n- `[input_path]`: Path to SCSS file or directory containing SCSS files to be compiled, relative to the current working directory.\n- `[output_path]`: Path to file or directory where CSS + source map files will be stored, relative to input root (if not provided, `css/` is used).\n\n**📝 Note:** If folders are passed, files will be processed recursively unless `-R` or `--no-recursion` is passed.\n\n#\n\nTo use as a **package script**, in your project's `package.json`:\n\n```json\n  \"scripts\": {\n    \"build:css\": \"\u003cscss-to-css-cmd\u003e\"\n  },\n```\n\nReplace `\u003cscss-to-css-cmd\u003e` with `scss-to-css` + optional args. Then, `npm run build:css` can be used to run the command.\n\n#\n\n### Example commands\n\nCompile all SCSS files in the **current directory** (outputs to `css/`):\n\n```\n$ scss-to-css\n```\n\nCompile all SCSS files in a **specific directory** (outputs to `css/path/to/your/directory/`):\n\n```\n$ scss-to-css path/to/your/directory\n```\n\nCompile a **specific file** (outputs to `css/path/to/your/file.min.css`):\n\n```\n$ scss-to-css path/to/your/file.scss\n```\n\nSpecify both **input and output** directories (outputs to `output_folder/`):\n\n```\n$ scss-to-css input_folder output_folder\n```\n\n**📝 Note:** Output CSS is minified unless `-M` or `--no-minify` is passed.\n\n#\n\n### Command line options\n\n```\nBoolean options:\n -n, --dry-run               Don't actually compile the file(s), just\n                             show if they will be processed.\n -d, --include-dotfolders    Include dotfolders in file search.\n -S, --no-source-maps        Prevent source maps from being generated.\n -M, --no-minify             Disable minification of output CSS.\n -R, --no-recursion          Disable recursive file searching.\n -r, --relative-output       Output files relative to each source file instead of to input root.\n -c, --copy                  Copy compiled CSS to clipboard instead of\n                             writing to file if single source file is\n                             processed.\n -q, --quiet                 Suppress all logging except errors.\n\nParameter options:\n --ignores=\"dir/,file1.scss,file2.scss\"   Files/directories to exclude from\n                                          compilation.\n --comment=\"comment\"                      Prepend header comment to\n                                          compiled CSS. Separate by\n                                          line using '\\n'.\nInfo commands:\n -h, --help                  Display help screen.\n -v, --version               Show version number.\n```\n\n\u003cbr\u003e\n\n\u003cimg height=6px width=\"100%\" src=\"https://assets.scsstocss.org/images/separators/aqua-gradient.png?v=7e4a141\"\u003e\n\n## 🔌 API usage\n\nYou can also import **scss-to-css** into your app to use its API methods, both as an ECMAScript module or a CommonJS module.\n\n#### ECMAScript*:\n\n```js\nimport scssToCSS from '@adamlui/scss-to-css';\n```\n\n#### CJS:\n\n```js\nconst scssToCSS = require('@adamlui/scss-to-css')\n```\n\n###### _*Node.js version 14 or higher required_\n\n#\n\n### `compile(input[, options])`\n\n💡 Compiles SCSS based on the string input supplied.\n\nIf **source code** is passed, it is directly compiled, then an object containing `srcPath` + `code` + `srcMap` + `error` is returned:\n\n```js\nconst srcCode = 'h1 { font-size: 40px ; code { font-face: Roboto Mono }}',\n      compileResult = scssToCSS.compile(srcCode)\n\nconsole.log(compileResult.error) // outputs runtime error, or `undefined` if no error\nconsole.log(compileResult.code)  // outputs minified CSS: 'h1{font-size:40px}h1 code{font-face:Roboto Mono}'\n```\n\nIf a **file path** is passed, the file's code is loaded then compiled to CSS, returning an object like above.\n\nIf a **directory path** is passed, SCSS files are searched for (recursively by default), each one's code is loaded then compiled, then an array of objects containing `srcPath` + `code` + `srcMap` + `error` is returned:\n\n```js\n// Outputs paths to SCSS files in working directory + all nested directories\nconst compileResults = scssToCSS.compile('.')\ncompileResults.forEach(result =\u003e console.log(result.srcPath))\n\n// Outputs compiled CSS from 2nd SCSS file if found, or `undefined` if not found\nconsole.log(compileResults[1].code)\n```\n\nOptions are boolean, passed as object properties. For example:\n\n```js\n// Returns array of data objects where `.code` contains unminified CSS\nscssToCSS.compile(inputDir, { minify: false })\n```\n\nAvailable parameters (and their default settings) are:\n\nName             | Type    | Desciption                                                              | Default value\n-----------------|---------|-------------------------------------------------------------------------|---------------\n`recursive`      | Boolean | Recursively search for nested files if dir path passed.                 | `true`\n`verbose`        | Boolean | Show logging in console/terminal.                                       | `true`\n`dotFolders`     | Boolean | Include dotfolders in file search.                                      | `false`\n`minify`         | Boolean | Minify output CSS.                                                      | `true`\n`sourceMaps`     | Boolean | Generate CSS source maps.                                               | `true`\n`relativeOutput` | Boolean | Output files relative to each source file instead of to input root.     | `false`\n`ignores`        | Array   | Files/dirs to exclude from compilation.                                 | `[]`\n`comment`        | String  | Header comment to prepend to compiled CSS. Separate by line using '\\n'. | `''`\n\n#\n\n### `findSCSS(searchDir[, options])`\n\n💡 Searches for all SCSS files within the `searchDir` string passed (useful for discovering what files [`compile()`](#compileinput-options) will process) and returns an array containing their filepaths.\n\nOptions are boolean, passed as object properties. For example:\n\n```js\n// Search for SCSS files in exactly assets/scss\nconst searchResults = scssToCSS.findSCSS('assets/scss', { recursive: false })\nconsole.log(searchResults)\n\n/* sample output:\n\nfindSCSS() » Searching for SCSS files...\nfindSCSS() » Search complete! 2 files found.\nfindSCSS() » Check returned array.\n[\n  'E:\\\\js\\\\utils\\\\scss-to-css\\assets\\\\scss\\\\foo.scss',\n  'E:\\\\js\\\\utils\\\\scss-to-css\\assets\\\\scss\\\\bar.scss'\n]\n*/\n```\n\nAvailable parameters (and their default settings) are:\n\nName          | Type    | Desciption                                               | Default value\n--------------|---------|----------------------------------------------------------|---------------\n`recursive`   | Boolean | Recursively search for nested files in searchDir passed. | `true`\n`verbose`     | Boolean | Show logging in console/terminal.                        | `true`\n`dotFolders`  | Boolean | Include dotfolders in file search.                       | `false`\n`ignores`     | Array   | Files/dirs to exclude from search results.               | `[]`\n\n\u003cbr\u003e\n\n\u003cimg height=6px width=\"100%\" src=\"https://assets.scsstocss.org/images/separators/aqua-gradient.png?v=7e4a141\"\u003e\n\n## 🏛️ MIT License\n\n**Copyright © 2024 [Adam Lui](https://github.com/adamlui) \u0026 contributors**\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\u003cbr\u003e\n\n\u003cimg height=6px width=\"100%\" src=\"https://assets.scsstocss.org/images/separators/aqua-gradient.png?v=7e4a141\"\u003e\n\n## 🛠️ Related utilities\n\n### [\u003c/\u003e minify.js](https://minify-js.org) \u0026nbsp;\u003ca href=\"https://github.com/toolleeo/cli-apps#programming\"\u003e\u003cimg height=18 src=\"https://assets.scsstocss.org/images/badges/awesome/badge.svg?v=7e4a141\"\u003e\u003c/a\u003e\n\n\u003e Recursively minify all JavaScript files.\n\u003cbr\u003e[Install](https://node.minify-js.org/#-installation) /\n[Readme](https://node.minify-js.org/#readme) /\n[CLI usage](https://node.minify-js.org/#-command-line-usage) /\n[API usage](https://node.minify-js.org/#-api-usage) /\n[Discuss](https://github.com/adamlui/minify.js/discussions)\n\n\u003cbr\u003e\n\n\u003cimg height=6px width=\"100%\" src=\"https://assets.scsstocss.org/images/separators/aqua-gradient.png?v=7e4a141\"\u003e\n\n\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://assets.scsstocss.org/images/icons/home/white/icon32x27.png?v=7e4a141\"\u003e\u003cimg height=13 src=\"https://assets.scsstocss.org/images/icons/home/dark-gray/icon32x27.png?v=7e4a141\"\u003e\u003c/picture\u003e \u003ca href=\"https://js-utils.org\"\u003e**More JavaScript utilities**\u003c/a\u003e /\n\u003ca href=\"https://github.com/adamlui/scss-to-css/discussions\"\u003eDiscuss\u003c/a\u003e /\n\u003ca href=\"#top\"\u003eBack to top ↑\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamlui%2Fscss-to-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamlui%2Fscss-to-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamlui%2Fscss-to-css/lists"}