WORK IN PROGRESS...
This Node module is an attempt to provide a faster binding to Ruby Sass than currently available.
Explanation: Sass in a Rails app with LiveReload seems much faster than things like gulp-ruby-sass. I'm guessing this is because Rails runs Sass using the same Ruby process every compile, avoiding Ruby spin-up time, and benefiting from in-memory caching. This module tries to do something similar. Benchmarks to follow.
$ npm install ruby-sass
var sass = require('ruby-sass');
sass('path/to/something.scss', function (err, css) {
// got the css (or an error with a *sass* stack trace)
});
Repeated calls should be faster than the first one.
You can also pass options as a second argument.
loadPaths
(array)sourcemap
(boolean)var Sass = require('ruby-sass').Sass;
var sass = new Sass();
sass.compile(filename, options, callback); // same as the `sass` function in standard API.
These are optional.
port
– which port to usebasePort
(default: 8500
) – if you don't set a port
, portfinder will be used to find one manually, starting at this base port.MIT