Socket
Book a DemoInstallSign in
Socket

node-sass-loader

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sass-loader

A helper library for the node-sass module. This provides a call to compile a directory to another directory.

0.1.7
latest
Source
npmnpm
Version published
Maintainers
3
Created
Source

#node-sass-loader

Overview

This is a node module created to extend functionality of the node-sass module.

This provides a simple function that takes in a source and a destination directory. Then it will traverse the source directory, compiling each file it finds. It will then place the compiled css into the correct output folder, relative to the source directory it was located in.

Installation

// to install in the local directory
npm install node-sass-loader

// to install in the local directory and save to the package.json
npm install node-sass-loader --save

Example Usage

Pretend you have a directory

/Users/username/node project/

And this folder has the directory structure /Users/username/node project/
|__css (This is an empty directory)
...
|__scss
    |__main styles
        |__default.scss
        |__main.scss
    |__mobile styles
        |__default.scss
        |__main.scss

Loading from Source Directory to Destination Directory

// First load the module
var nodeSassLoader = require('node-sass-loader');
// Call the compilation
nodeSassLoader.compile({ source_directory: '/Users/username/node project/sass'),
                         destination_directory: '/Users/username/node project/css') });

The result is that the css folder will now have the css files and directory structure that the sass folder had.

/Users/username/node project/
|__css
    |__main styles
        |__default.css
        |__main.css
    |__mobile styles
        |__default.css
        |__main.css
|__scss
    |__main styles
        |__default.scss
        |__main.scss
    |__mobile styles
        |__default.scss
        |__main.scss

Using Include Paths

If you wish to use the include paths property you can do so like this:

// First load the module
var nodeSassLoader = require('node-sass-loader');
// Call the compilation
nodeSassLoader.compile({ source_directory: '/Users/username/node project/sass'),
                         destination_directory: '/Users/username/node project/css'),
                         include_paths: [ /* array of paths here */ ] });

Additional Features

If there are additional features or issues, please file an issue in the issues section of the repository. Or, feel free to create your own addition and file a pull request to integrate the features.

Keywords

node-sass

FAQs

Package last updated on 25 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.