node-sass-wrapper

A wrapper around the command line Sass gem.

npm install node-sass-wrapper
1 downloads in the last day
7 downloads in the last week
22 downloads in the last month

node-sass-wrapper

node-sass-wrapper is a wrapper around the command line Sass gem.

Install

$ npm install node-sass-wrapper

Example

Call compile with the path to your Sass stylesheet:

  var sass = require('node-sass-wrapper');

  sass.compile('path/to/style.sass', function (err, css) {
    if (err) throw err;
    fs.writeFileSync('path/to/style.css', css);
  });

You can also pass in options:

  var sass = require('node-sass-wrapper');

  var options = {
    compass : true,
    style   : 'compact'
  };

  sass.compile('path/to/style.sass', options, function (err, css) {
    if (err) throw err;
    fs.writeFileSync('path/to/style.css', css);
  });

API

compile(path, [options], callback)

Compile the Sass file at path and callback(err, css). options are optional and map directly to their command line equivalents:

  {
    compass   : false,
    loadPath  : null,
    noCache   : false,
    precision : 3,
    require   : null,
    style     : 'nested'
  }

License

MIT

Based on @ckhampus's node-sass.

npm loves you