coffee-middleware
coffee-script middleware for connect.
Last updated 5 years ago by marekbernat .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install coffee-middleware 
SYNC missed versions from official npm registry.

YO!

This is adapted from the less middleware written by zoramite We have removed LESS specific, replaced it with the coffee-script equivalent, removed dependance on static files, and added inline sourcemaps.

Installation

npm install coffee-middleware

Options

Option Description Default
force Always re-compile coffee-script files on each request. false
once Only check for need to recompile once after each server restart. Useful for reducing disk i/o on production. false
debug Output any debugging messages to the console. false
bare Compile the JavaScript without the top-level function safety wrapper. false
src Source directory containing the .coffee files. Required.
encodeSrc Encode CoffeeScript source file as base64 comment in compiled JavaScript true
prefix Path which should be stripped from the public pathname.

Examples

Connect

var coffeeMiddleware = require('coffee-middleware');

var server = connect.createServer(
    coffeeMiddleware({
        src: __dirname + '/public',
        compress: true
    }),
);

Express

var coffeeMiddleware = require('coffee-middleware');

var app = express.createServer();

app.configure(function () {
    // Other configuration here...

    app.use(coffeeMiddleware({
        src: __dirname + '/public',
        compress: true
    }));
});

Current Tags

  • 0.3.0                                ...           latest (5 years ago)

1 Versions

  • 0.3.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |