node-sass
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
async-foreach | 0.1.3 | 4.52 kB | UNKNOWN | prod | 1 |
chalk | 4.1.2 | 11.31 kB | MIT | prod | |
cross-spawn | 7.0.3 | 7.3 kB | MIT | prod | |
gaze | 1.1.3 | 8.66 kB | MIT | prod | |
get-stdin | 4.0.1 | 978 B | MIT | prod | |
glob | 7.2.3 | 15.08 kB | ISC | prod | |
lodash | 4.17.21 | 311.49 kB | MIT | prod | |
make-fetch-happen | 10.2.1 | 18.08 kB | ISC | prod | 1 2 |
meow | 9.0.0 | 7.38 kB | MIT | prod | 1 2 |
nan | 2.19.0 | 419.43 kB | MIT | prod | |
node-gyp | 8.4.1 | 436.59 kB | MIT | prod | 1 3 |
sass-graph | 4.0.1 | 4.8 kB | MIT | prod | |
stdout-stream | 1.4.1 | 2.36 kB | MIT | prod | |
true-case-path | 2.2.1 | 7.52 kB | Apache-2.0 | prod |
Node-sass is a library that provides binding for Node.js to LibSass, the C version of the popular stylesheet preprocessor, Sass. It allows you to natively compile .scss files to css at over-the-top speed and automatically via a connect middleware. Note though, LibSass and Node Sass are deprecated and while they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Therefore, projects that still use it should transition onto Dart Sass.
You can use node-sass by installing it via npm using the command npm install node-sass
. After installation, you can use it in your JavaScript code as follows:
var sass = require('node-sass');
sass.render({
file: scss_filename,
options: {
// specify options here
}
}, function(err, result) { /* handle error or result here */ });
// You can also use it synchronously
var result = sass.renderSync({
data: scss_content,
options: {
// specify options here
}
});
In this usage example, file
and data
are either the path to an .scss file or .scss content to be compiled respectively.
The node-sass documentation can be found on its GitHub page. This includes the API, options you can pass to the render function such as file
, outputStyle
, sourceMap
among others. There are also details on how you can use it in the command-line interface.