callumlocke / node-ruby-sass

1 stars 1 forks source link

node-ruby-sass

Build Status

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.

Installation

$ npm install ruby-sass

Usage

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.

Options

Alternative API

var Sass = require('ruby-sass').Sass;

var sass = new Sass();

sass.compile(filename, options, callback); // same as the `sass` function in standard API.

Constructor options

These are optional.

To do

Licence

MIT