This function synchronously compiles a Sass file to CSS. If it succeeds, it
returns the result, and if it fails it throws anerror.
⚠️ Heads up!
When using the sass-embedded npm package, render
is almost always faster than renderSync, due to the overhead of
emulating synchronous messaging with worker threads and concurrent
compilations being blocked on mainthread.
Example
constsass = require('sass'); // or require('node-sass');
This function synchronously compiles a Sass file to CSS. If it succeeds, it returns the result, and if it fails it throws an error.
⚠️ Heads up!
When using the
sass-embedded
npm package, render is almost always faster than renderSync, due to the overhead of emulating synchronous messaging with worker threads and concurrent compilations being blocked on main thread.Example
Deprecated
Use compile or compileString instead.