jadist

0.2.3 • Public • Published

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 apprequire('./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)

Readme

Keywords

Package Sidebar

Install

npm i jadist

Weekly Downloads

2

Version

0.2.3

License

MIT

Last publish

Collaborators

  • johnnydevmode
  • bitbutcher