0.1.0 • Published 4 years ago

node-sass-runner v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

node-sass-runner

Node sass runner compile sass via command line with specified compiler, and can use watcher functionalities.

Options

Every option can be specified in the config file.

The config file path is set by default to ./sass.config.js, and exports an object with the needed options.

You can change it using the command line flag --config followed by the new path.

Note: the config file path is relative to process path.

title

  • Type: string
  • Default: "node sass runner"
  • Optional

Is the prefix that will appear in every message printed in console.

sass

  • Type: Object
  • Default: null
  • Mandatory

Contains every option needed to compile sass.

implementation

  • Type: Object
  • Default: null
  • Mandatory

Object of sass compiler implementation you want to use.

cwd

  • Type: string
  • Default: null
  • Mandatory

Current Working Directory for input files.

src

  • Type: Array
  • Default: null
  • Mandatory

Array of files that will be used as input. Accepts glob patterns.

outFileFunction

  • Type: Function
  • Arguments: file
  • Default: null
  • Mandatory

Returns outFile path. Accepts input file path as argument.

options

  • Type: Object
  • Default: null
  • Optional

Options used by the compiler. It can be filled in accordance with the implementation used.

watcher

  • Type: Object
  • Default: null
  • Optional

Contains every argument needed by the watcher. Must be specified if the watch option is active.

paths

  • Type: string||[string]
  • Default: null
  • Mandatory

Paths to files, dirs to be watched recursively, or glob patterns. Look at chokidar documentations for more informations.

options

  • Type: string||[string]
  • Default: null
  • Optional

Options used by the watcher. Look at chokidar documentations for more informations.

watch

  • Type: boolean
  • Default: null
  • Optional

Activate the files watch mode.

verbose

  • Type: boolean
  • Default: null
  • Optional

Activate the verbose messages option.

before

  • Type: String
  • Default: null
  • Optional

Script to run before running sass compilation. In watch mode it will be used only in the first run.

after

  • Type: String
  • Default: null
  • Optional

Script to run after running sass compilation. In watch mode it will be used only in the first run.

beforeWatch

  • Type: String
  • Default: null
  • Optional

Script to run before running sass compilation. It will be used only in watch mode, from the second run. If same is active, it will be ignored.

afterWatch

  • Type: String
  • Default: null
  • Optional

Script to run after running sass compilation. It will be used only in watch mode, from the second run. If same is active, it will be ignored.

same

  • Type: boolean
  • Default: null
  • Optional

If set to true, before and after will be used in every run.

Command Line Interface

Usage

node sass.js [options]

Options:

    -w, --watch                Activate Watch mode.
    -i                         Activate info mode. Every message of type info will appear in console.
    -v                         Activate verbose mode. Every message of type verbose or info will appear in console.
    -s                         Use before and after script for every run.
    --config                   Specify the config file path, instead the default one ('./sass.config.js').
    --before                   Script to run before the compilation, only in the first run.
    --after                    Script to run after the compilation, only in the first run.
    --beforeWatch              Script to run before the compilation, only in the watch mode and from the second run.
    --afterWatch               Script to run after the compilation, only in the watch mode and from the second run.
0.1.0

4 years ago