{"id":32119048,"url":"https://github.com/hironichu/denosass","last_synced_at":"2025-10-20T17:57:36.515Z","repository":{"id":42977868,"uuid":"458370321","full_name":"hironichu/denosass","owner":"hironichu","description":"DenoSass is a complete nearly fully featured Sass compiler for Deno and Browser","archived":true,"fork":false,"pushed_at":"2025-01-03T06:21:12.000Z","size":2479,"stargazers_count":43,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-20T17:57:10.790Z","etag":null,"topics":["compiler","deno","preprocessor","sass"],"latest_commit_sha":null,"homepage":"https://deno.land/x/denosass","language":"SCSS","has_issues":false,"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/hironichu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"patreon":"Hironichu","github":"Hironichu"}},"created_at":"2022-02-11T23:30:07.000Z","updated_at":"2025-08-10T18:03:23.000Z","dependencies_parsed_at":"2024-11-14T22:00:47.784Z","dependency_job_id":"cd4f1235-b02b-4569-8fb9-cea6f3946867","html_url":"https://github.com/hironichu/denosass","commit_stats":{"total_commits":21,"total_committers":5,"mean_commits":4.2,"dds":"0.38095238095238093","last_synced_commit":"ab3faff7c9274e0278587771b0c2250f1d687330"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/hironichu/denosass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hironichu%2Fdenosass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hironichu%2Fdenosass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hironichu%2Fdenosass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hironichu%2Fdenosass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hironichu","download_url":"https://codeload.github.com/hironichu/denosass/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hironichu%2Fdenosass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280135884,"owners_count":26278444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["compiler","deno","preprocessor","sass"],"created_at":"2025-10-20T17:57:31.492Z","updated_at":"2025-10-20T17:57:36.493Z","avatar_url":"https://github.com/hironichu.png","language":"SCSS","funding_links":["https://patreon.com/Hironichu","https://github.com/sponsors/Hironichu"],"categories":[],"sub_categories":[],"readme":"# Deno Sass 🦕\n\n\u003cimg src=\"https://github.com/hironichu/denosass/raw/main/assets/DenoGrass.jpg\" height=\"auto\"\u003e\n\u003e A Deno+Wasm Sass compiler\n----\n\n# No longer maintained.\n\nWelcome to the new re-written Deno Sass module, with complete feature set\n(import, variables, functions, mixins, and even CLI !)\n\nI spent 24h updating the module to make it work, it now has a new name\n(previously Degrass) which I think sounds better.\n\nPlease note that even tho I believe i have tested every test case for this, i\ndon't know how good it can handle things..\n\nI know that there are some errors that might now be shown at compile time, but\nno crash so far.\n\n## \u003e ⚠️ This module will soon be re-writen with a new external library called Rsass, it will also be using FFI for the Deno port and a smaller version in WebAssembly for browsers.\n\n## Command line\n\n```bash\n# Install via \ndeno install --allow-env --allow-write --allow-read --allow-net --unstable -n denosass https://raw.githubusercontent.com/hironichu/denosass/main/cli.ts\n# Basic example\n\n# This will take every file in the dir (non recursively) and compile then while keeping their name and adding .min.css, into the ./out folder.\ndenosass compile -f compressed -o ./out ./scssdir\n\n# This will compile only the main.scss file and output the content to ./out/main.min.css \ndenosass compile -f compressed -o ./out ./scssdir/main.scss\n\n# Denosass accepts multiple output, and will if set, combine them together, or just compile them as normal.\ndenosass compile -f compressed -o ./out ./scssdir ./anotherfolder ./afile.scss\n\n# The above example will look for the first file in \n# ./scssdir and ./anotherfolder , \n# compile them while including the @imports and so on,\n# and will also compile the ./afile.scss to its own \n# (if this file includes modules within the other folder, Denosass will include them.)\n\n#Last but not least, if you don't set -o (output dir) denosass will write content to the STDOUT. (using Deno.stdout.writeSync())\ndenosass compile -f compressed ./some/folder ./or/some/file.scss\n\n#CLI Support also STDIN, if you set no argument you can use the Standard input to compile Sass.\ndenosass compile\n🔵[DenoSass] Write your sass code to stdin and press CTRL-D to compile\nbody {\ncolor:red;\n}\nbody{color:red}%\n```\n\nPlease note that if the output folder doesn't exist, Denosass will create it, if\nit exists, Denosass will empty it's content before creating new files.\n\n\u003e Every CSS file created are read only file (644)\n\n## The API\n\nI have been working really hard to make a very user friendly API only one\nfunction is necessary to instanciate the Sass Class, you can however import it\nand use it how you want.\n\n## Here is a basic rundown on how the API works.\n\n### Compiling Text\n\nBasic example, this will only compile the text within the brackets. To export\nthe result you need to call one of these functions :\n\n- .to_string(format: \"expanded\" | \"compressed\")\n- .to_buffer(format: ...)\n- .to_file( { destDir, destFile, format } )\n\n```ts\nimport sass from \"https://deno.land/x/denosass/mod.ts\";\n\nconst compiler = sass(`\n  body {\n    background: orange;\n    \u003e.container {\n      color: black;\n      display:flex;\n      \u0026.some {\n        content: \"Some text content\";\n      }\n    }\n  }\n`);\n```\n\nsass take an optional object as an argument, which contains the ability to set\nthe format for the next function call (.to_string..) here is an example :\n\n```ts\nconst from_files = sass(`...`, {\n  //The load_paths will allow you to import files that are somewhere else in your system, note that this feature is still unstable !\n  load_paths: [\"some/relative/path\", \"/or/absolute/include/path\"],\n  quiet: true, // Optional, Define if you want to see Sass warning or not.\n  style: \"compressed\", //Optional, by default \"compressed\" is selected.\n});\n```\n\nOnce you're done, call one of the function, if you don't set a format, the\ndefault one will be \"compressed\"\n\n```ts\nconst css = compiler.to_string();\nconsole.log(css);\n```\n\nYou can also export to a buffer, note that you can call .to_string(),\nto_buffer() and to_file() as much as you want. All data will be read by the\nWebAssembly VM at compile time, Deno checks if everything is right to compile.\n\nHere you can export to a folder the content you compiled : same as before,\nformat is not mandatory if you set destFile , Deno will output content in this\nfile, if you don't, a untitled.min.css file will be created\n\n```ts\ncompiler.to_file({\n  destDir: \"./out\",\n});\n```\n\n---\n\n### Compiling Files / Folders / Buffer\n\nDenosass takes both arrays of string, strings and buffers, as shown here :\n\n```ts\n// Here we have one folder and a file.\nconst compile = sass([\"path/to/some/folder\", \"path/to/file.scss\"]);\n```\n\nBy default it will look for every .scss and .sass file in the subfolders, too. You can limit the depth of the search by setting the walkMaxDepth option.\n\n```ts\n// Here we are limiting the depth to 2, so it will only look for files in the folder and its direct subfolders\nconst compile = sass([\"path/to/some/folder\"], {\n  walkMaxDepth: 2,\n});\n```\n\n```ts\n\n\u003e ### ⚠️ PSA, Denosass perform no Content type check for the file / folder you use, it's entirely up to you. it will look for .scss and .sass file only, ⚠️\n\nHere is an example on how you can use a buffer\n\n```ts\n//This is not really useful, only if you want to catch a buffer from a request without transforming it to a string.\nconst compile = sass(Deno.readFileSync(\"somefile.scss\"));\n```\n\n### Features subject to changes\n\nFor now, if you set a filename during the export to File, (both in CLI and in\nthe API), Denosass will append every file you have imported into a single one\nwith that name, this is useful if you want to build a static app with one single\nCSS file, but it might now be convenient.\n\nThat's why setting a name isn't required by default.\n\n```ts\nconst compiler = compile('some/folder');\ncompiler.to_file({\n  destDir: \"./dist\",\n  destFile: \"mysupercss\" //the extension is set depending on the format.\n  format: \"compressed\"\n}) //Returns a boolean.\n```\n\n## Browser API\n\nAs of today, some feature are not available in browsers, (such as files/folder),\nI need to edit some stuff so the Deno namespace doesn't stop the code from\nrunning in modern browsers, but it should work as the older one did. g\n\n## Deploy\n\nThis module should work today, with the entire featureset on Deploy\n\n## Core API\n\nBy default, i made a wrapper around the function exported form the Wasm code,\nthis is because I want to have some nice feature around (such as multiple file\nsupport, export to file/buffer etc...)\n\nhowever you can directly use these functions if you don't need the additional\nfeatures.\n\n```ts\nimport { file, str } from \"./wasm/grass.deno.js\";\n\n//From a string, note that it will resolve any imported module from import.meta.url (the current dir of the typescript file being executed.)\nconst fromstr = str(\n  `\n  @import 'superlib';\n`,\n  {\n    load_paths: [\n      \"./libscss\",\n      \"/Users/ekko/Documents/testscss\",\n    ],\n    style: \"expanded\",\n    quiet: true,\n  },\n);\nconsole.log(fromstr);\n\n//And from a file\nconst fromfile = file(`./myscss/myscss.scss`, {\n  load_paths: [\n    \"./libscss\",\n    \"/Users/ekko/Documents/testscss\",\n  ],\n  style: \"expanded\",\n  quiet: true,\n});\nconsole.log(fromfile);\n///\n```\n\n---\n\nAnd that's about it, thank you for reading, I have been spending now 25 hours\nwriting all of this module from the ground up !\n\nFeel free to share and support my work using Sponsors, I'd really appreciate it.\n\nMade with ❤️ for the Deno community. 🦕\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhironichu%2Fdenosass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhironichu%2Fdenosass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhironichu%2Fdenosass/lists"}