UNPKG

692 BJavaScriptView Raw
1'use strict';
2
3/**
4 * Coffee plugin for Crixalis. Depends on static and processor plugins.
5 * Provides simple wrapper around [Coffee](http://coffeescript.org) language.
6 * @module Crixalis
7 * @submodule coffee
8 * @for Controller
9 */
10
11var Crixalis = require('../controller'),
12 coffee = require('coffee-script'),
13 cache = {};
14
15module.exports = function (options) {
16
17 /**
18 * Compile coffeescript and send it to client
19 * @method coffee
20 * @param {String} script Path to coffee script source file
21 * @chainable
22 */
23 Crixalis.plugin('processor', {
24 method : 'coffee',
25 extension : 'js',
26 compile : function (filename, data, options) {
27 return coffee.compile(data);
28 }
29 });
30};