mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-30 04:39:03 +01:00
Update the JS API documentation (#680)
This commit is contained in:
parent
7857c9eb09
commit
819d357cb8
21
README.md
21
README.md
@ -144,16 +144,19 @@ That's it!
|
||||
|
||||
## JavaScript API
|
||||
|
||||
When installed via npm, Dart Sass supports a JavaScript API that aims to be
|
||||
compatible with [Node Sass](https://github.com/sass/node-sass#usage). Full
|
||||
compatibility is a work in progress, but Dart Sass currently supports the
|
||||
`render()` and `renderSync()` functions. Note however that by default,
|
||||
**`renderSync()` is more than twice as fast as `render()`**, due to the overhead
|
||||
of asynchronous callbacks.
|
||||
When installed via npm, Dart Sass supports a JavaScript API that's fully
|
||||
compatible with [Node Sass][] (with a few exceptions listed below), with support
|
||||
for both the `render()` and `renderSync()` functions. See [the Sass
|
||||
website][js api] for full API documentation!
|
||||
|
||||
To avoid this performance hit, `render()` can use the [`fibers`][fibers] package
|
||||
to call asynchronous importers from the synchronous code path. To enable this,
|
||||
pass the `Fiber` class to the `fiber` option:
|
||||
[Node Sass]: https://github.com/sass/node-sass
|
||||
[js api]: https://sass-lang.com/documentation/js-api
|
||||
|
||||
Note however that by default, **`renderSync()` is more than twice as fast as
|
||||
`render()`** due to the overhead of asynchronous callbacks. To avoid this
|
||||
performance hit, `render()` can use the [`fibers`][fibers] package to call
|
||||
asynchronous importers from the synchronous code path. To enable this, pass the
|
||||
`Fiber` class to the `fiber` option:
|
||||
|
||||
[fibers]: https://www.npmjs.com/package/fibers
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user