开发者社区> 镜像站> NPM> file-system-css
file-system-css
A super-fast CSS compiler that finds, builds, caches and monitors files across the file-system.
Last updated 5 years ago by philcockfield .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install file-system-css 
SYNC missed versions from official npm registry.

file-system-css

Build Status

A super-fast CSS compiler that finds, builds, caches and monitors files across the file-system.

Supported formats:

  • .css - Plain CSS
  • .styl - Stylus

Usage

Pass a path (or array of paths) to the folders containing your source files (.css, .styl):

import css from "file-system-css";

css.compile(["./site", "./mixins"], { minify: true })
.then(result => {
    // Do something with the resulting CSS, for example:
    req.send(result.css);
})
.catch(err => throw(err));

Options

Pass in options to the compiler (default values shown):

{
  watch: false,         // Flag indicating if file-system watching is enabled.
  minify: false,        // Flag indicating if the css should be minified.
  cache: true,          // Flag indicating if caching should be employed.
  pathsRequired: true   // Flag indicating if an error should be thrown if the
                        // given paths do not exist.
}

css.compile("./path", { /* options */ });

Stylus

The nib CSS3 extensions are automatically imported and are available in any of your .styl files.

Create your own mixins, anywhere, by naming your file <name>.mixin.styl. Just like the nib library, these mixins will be automatically available to all your .styl files. No need to @import them.

Test

npm test

Current Tags

  • 1.0.17                                ...           latest (5 years ago)

2 Versions

  • 1.0.17                                ...           5 years ago
  • 1.0.16                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (9)
Dev Dependencies (5)