piping-styles

Keep your styles piping hot! Rebuild your styles on change without binaries

npm install piping-styles
12 downloads in the last month

Piping-styles

Similar stuff to piping and piping-browser but for stylesheets. currently supports stylus with (optional) nib.

Installation

npm install piping-styles

Usage

Piping-styles is not a binary, so you can continue using your current workflow for running your application ("wooo!"). Basic usage is as follows:

require("piping-styles")({main:"./client/styles/app.styl",out:"./public/app.css"});

Options

  • main (path): The path to your top style
  • out (path): The path to where you want your css to be written to. Relative to the file where piping-styles was required
  • ignore (regex): Files/paths matching this regex will not be watched. Defaults to /(\/\.|~$)/
  • minify (boolean): Whether to minify all css output. Defaults to false
  • watch (boolean): Whether or not piping should rebuild on changes. Defaults to true, could be set to false for production
  • includeModules (boolean): Whether to include files located in node_modules folders when watching. defaults to false
  • vendor (object): Specify configuration for building vendor files. Vendor files are concatenated in order, and written to the given path.
    • path (string): Directory where vendor files are located, relative to file where piping-styles was required
    • out (string): Path where vendor ouput should be written, relative to the file where piping-styles was required
    • files (array): Array of vendor files, relative to vendor path.
  • build (object): An object that maps file extensions, eg ".styl" to functions that take a filename, file data, and a callback and compile the source, sending it to the callback.

Piping-styles can also be used just by passing two strings. In this case, the strings are taken as the main and out options

require("piping-styles")("./client/styles/app.styl","./public/app.css");

piping-styles plays nice with piping. To use it, ensure piping-styles is required when piping returns false:

if(!require("piping")()){
  require("piping-styles")("./client/styles/app.styl","./public/app.css");
  return;
}
// application logic here
npm loves you