Created: 2012-03-24 02:35
Updated: 2014-01-08 20:40
License: mit


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.


Use it in your scripts by specifying a file

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

Or by specifying a string and a path to use instead

Cocat = require('cocat');
  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]


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


$ 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!

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more