Socket
Book a DemoInstallSign in
Socket

coffee-fast-compile

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffee-fast-compile

Module for fast compilation whole directories with very simple API

latest
Source
npmnpm
Version
0.2.3
Version published
Maintainers
1
Created
Source

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');
});

FAQs

Package last updated on 30 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts