Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Node module for asynchronous CSS file concatenation
CoffeeScript JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
src
test
.gitignore
LICENSE
Makefile
index.js
package.json
readme.md

readme.md

Cocat

Node module for asynchronous CSS file concatenation. Looks for @import statements and replaces them with the actual content of the file if it exists, otherwise it just leaves the @import statement as-is.

Usage

Use it in your scripts by specifying a file

Cocat = require('cocat');
Cocat.concat({
  filename: 'path_to_file.css'
}, function(err, output) {
  // ...
});

Or by specifying a string and a path to use instead

Cocat = require('cocat');
Cocat.concat({
  content: '/* CSS GOES HERE */'
  path:    '../foo/bar/'
}, function(err, output) {
  // ...
});

It also works great on the command line:

Usage: cocat [options] input.css [output.css]

Options:

  -h, --help     output usage information
  -V, --version  output the version number
  -s, --save     save output to a file based on the inputfile name

Examples:

$ cocat bar.css          # concats and ouputs to stdout
$ cocat -s foo.css       # concats and saves to foo.concat.css
$ cocat baz.css qux.css  # concats and saves to qux.css

Happy concatenating!

Something went wrong with that request. Please try again.