0.2.3 • Published 8 years ago

jadist v0.2.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Jadist

An express view engine that proxies Jade to allow for pre-compilation of Jade templates to a single JavaScript file for production.

Getting Started

Install Jadist:

npm install jadist --save

Examples

Jadist was written to improve the render performance of Jade templates in Express apps written in CoffeeScript. As such, the examples will demonstrate its usage in this context. However, Jadist's API should translate well to pure JavaScript.

Precompile the Views

If you use Grunt for your build you may want to look into Grunt-Jadist for this step.

  # use jadist to precompile the views users.jade, accounts.jade, admins.jade
  jadist = require 'jadist'
  jadist.compile 'dest/views.js', 'views', 'views/users.jade', 'views/accounts.jade', 'views/admins.jade'

Configure The Middleware

#...
app.configure 'production', ->
  # use jadist to serve jade views that have been precompiled into views.js
  app.engine 'jade', require('jadist').engine app, require('./views')
#...

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Release History

(Nothing yet)

0.2.3

8 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

10 years ago

0.0.1

10 years ago