express-cjs
coffee-react / jade / stylus middleware for Single Page Application on Express4
Last updated 5 years ago by 59naga .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install express-cjs 
SYNC missed versions from official npm registry.

ExpressCjs NPM version Build Status Coverage Status

coffee-react / jade / stylus middleware for Single Page Application on Express4

API

expressCjs(options) -> middleware

  • If GET / to parse /index.jade
  • If GET /index.js to parse /index.coffee with ng-annotate
  • If GET /index.css to parse /index.styl with kouto-swiss
// Dependencies
var express= require('express');
var cjs= require('express-cjs');

// Environment
if(process.env.PORT===undefined){
  process.env.PORT= 59798;
}
// Default options
var options= {
  // specify the parse location
  cwd: process.cwd(),

  // if true, compress & cache result
  debug: process.env.NODE_ENV==='production',

  // if true, include node_modules
  bundleExternal: true,

  // if true, use `coffee-reactify` (do not use `coffeeify`)
  useReactify: true,

  // if true, use `browserify-ngannotate` at /index.coffee
  useNgannotate: true,

  // if true, use `plain-jadeify` at /index.coffee
  usePlainJadeify: true,

  // if true, use `brfs` at /index.coffee
  useBrfs: true,

  // if true, always parse `/index.jade` at 'GET *' (for no matches)
  html5Mode: false,
};

// Setup & Boot
var app= express();
app.use(cjs(options));
app.listen(process.env.PORT,function(){
  console.log('http://localhost:%s <- %s',process.env.PORT,options.root);
});

Related projects

License

MIT

Current Tags

  • 0.0.10                                ...           latest (5 years ago)

16 Versions

  • 0.0.10                                ...           5 years ago
  • 0.0.9                                ...           5 years ago
  • 0.0.8                                ...           5 years ago
  • 0.0.7                                ...           5 years ago
  • 0.0.7-beta                                ...           5 years ago
  • 0.0.7-alpha                                ...           5 years ago
  • 0.0.6                                ...           5 years ago
  • 0.0.6-beta                                ...           5 years ago
  • 0.0.6-alpha                                ...           5 years ago
  • 0.0.5                                ...           5 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
  • 0.0.0                                ...           5 years ago
  • 0.0.0-alpha                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (15)
Dev Dependencies (5)

Copyright 2014 - 2016 © taobao.org |