node-sass
:rainbow: Node.js bindings to libsass
Node-sass was a library for compiling Sass stylesheets to CSS inside Node.js projects, but it has reached end of life with no further releases or security fixes, the project itself recommends migrating to Dart Sass.
Node-sass was a library that let JavaScript projects, specifically those running on Node.js, compile Sass stylesheets into regular CSS. Sass is a stylesheet language that extends CSS with features like variables, nesting, and reusable mixins. Node-sass did this compilation by wrapping LibSass, a C-language implementation of the Sass compiler, so the process was fast and could be done automatically as part of a build pipeline.
The most important thing to know about this repository is that node-sass has reached end of life. The project will receive no further releases, including security fixes. Anyone currently using it is encouraged to migrate to Dart Sass, which is the current officially maintained Sass compiler. The README opens with this warning, and it applies regardless of which version of node-sass a project is using.
During its active years, the library was installed through npm and used with a simple function call that accepted either a file path or a string of Sass content and returned compiled CSS. It supported custom importers for handling the @import directive in non-standard ways, custom functions that could be called from within Sass files, and source map generation for easier browser debugging. The library also included a command-line tool and integration with the Connect middleware commonly used in older Node.js web server setups.
Installation complexity was one of the long-standing pain points with node-sass. Because it included a native C++ binding, it had to be compiled for the specific version of Node.js in use. If you upgraded Node.js, you also had to reinstall or rebuild node-sass. The README includes a compatibility table showing which version of node-sass matched each version of Node.js, as well as a troubleshooting guide for common installation failures.
For any project starting fresh or considering a migration, Dart Sass is the replacement the project itself recommends.
Where it fits
- Migrate an existing node-sass build pipeline to Dart Sass to get continued security support
- Understand the version compatibility table to match node-sass version with the correct Node.js version in a legacy project
- Troubleshoot native compilation failures using the README's troubleshooting guide before migrating away