Source: apc-static/lib/compile/compile_coffee_script_string.js

/**
 * Compile coffee script string.
 * @function lib.compile.compileCoffeeScriptString
 * @see {@link http://coffeescript.org/ | coffee script}
 * @param {string} src - Source script string.
 * @param {function} callback - Callback when done.
 * @author Taka Okunishi
 *
 */
module.exports = function (src, callback) {
    var coffeeScript = require('coffee-script');
    try {
        var compiled = coffeeScript.compile(src, {bare: true});
        callback(null, compiled);
    } catch (e) {
        callback(e);
    }
};