W3cubDocs

/Sass

renderSync

  • This function synchronously compiles a Sass file to CSS. If it succeeds, it returns the result, and if it fails it throws an error.

    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

    constsass = require('sass'); // or require('node-sass');

    constresult = sass.renderSync({file:"style.scss"});
    // ...

    Deprecated

    Use compile or compileString instead.

    Parameters

    Returns LegacyResult

© 2006–2025 the Sass team, and numerous contributors
Licensed under the MIT License.
https://sass-lang.com/documentation/js-api/functions/renderSync