node sass code example

Example 1: node sass

npm install node-sass

Example 2: node sass version react

yarn add node-sass@4.14.1

Example 3: node sass

npm install node-sass

Example 4: node-sass run

npm install node-sass
node-sass ./styles.scss -o ./styles.css

Example 5: node-sass

var sass = require('sass');

sass.render({
  file: scss_filename
}, function(err, result) {
  /* ... */
});

// OR

var result = sass.renderSync({
  file: scss_filename
});

Example 6: scss npm

var sass = require('node-sass');
sass.render({
  file: scss_filename,
  [, options..]
}, function(err, result) { /*...*/ });
// OR
var result = sass.renderSync({
  data: scss_content
  [, options..]
});