Skip to content

A nodejs module that provides a friendly javascript API for interacting with sass

License

Notifications You must be signed in to change notification settings

gemeinling/sass-wrapper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sass-wrapper Build Status

A nodejs module that provides a friendly javascript API for compiling sass. This module is simply a wrapper around the sass utility, and thus you need to have sass installed on your system to use this module.

Installation

npm install sass-wrapper

Example

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

// You can specify a filepath to compile...
sass.compile({
  filepath: 'styles.scss',
  callback: function(err, data) {
    if (err) {
      console.log(err);
      throw err;
    }
    console.log(data);
  }
});

// Or pass in a string of sass...
sass.compile({
  data: '.mysass{.important{color:red;}}',
  type: 'scss', // {optional} 'scss' or 'sass' (defaults to 'scss')
  callback: function(err, data) {
    if (err) {
      console.log(err);
      throw err;
    }
    console.log(data);
  }
});

Options

{
  filepath: '/path/to/file.scss',
  data: '.mysass{.style{color:red}}',
  type: 'scss', 
  compass: true,
  style: 'nested',
  precision: 3,
  loadPath: '/path/to/dir'
}

Tests

Run the tests with npm test or grunt test.

About

A nodejs module that provides a friendly javascript API for interacting with sass

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.3%
  • CSS 4.7%