Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Module for fast compilation whole directories with very simple API.
JavaScript CoffeeScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
src
.gitignore
Cakefile
LICENSE
README.md
package.json

README.md

coffee-fast-compile

There are situations when you start thinking for coffee-script support in you lib/module. But interface provided by official cooffee-script module is ugly and don't allow you to watch dir inside your script. This module is built to solve such problems providing simple interface for compiling and watching whole directories built on top nodejs streams.

build

It just compiles everything from example dir and outputs code to output dir saving all relatives paths.

compile = require('coffee-fast-compile');
var pipe = compile.build('example', 'output', function(files) {
  console.log(files, ' was compiled');
});

pipe.on('data', function(file) {
  if(file === 'compiled') {
    console.log('compiled');
  } else {
    console.log(file, ' compiled');
  }
});

watch

The same as build, but recompiles changed files on the fly. You also can use pipe to monitor results. When initially called, it invokes build, so first compilation can be long. While watching it only compiles changed files.

compile = require('coffee-fast-compile');
var pipe = compile.watch('example', 'output', function(files) {
  console.log(files, ' was compiled');
});
Something went wrong with that request. Please try again.