Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
express middleware for supplying jade templates to the client
CoffeeScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
README.md
jade-frakt.coffee
jade-frakt.js
package.json

README.md

jade-frakt

Some express middleware for sending a bunch of jade templates to the client.

Example

var frakt = require('jade-frakt');

var app = express();
app.use(frakt(__dirname + '/clientTemplates'));

// This will yield any jade templates in /clientTemplates as locals in any
// request made. 

So if the contents of ./clientTemplates/ was:

template-1.jade
template-2.jade

You would gain two locals in your express response - 'template-1' and 'template-2' - which are your jade templates as strings.

frakt(dir, options)

  • dir - the directory to read templates from
  • options - optional - custom options

options

  • compile - default: false - whether or not to precompile your jade templates. the upside of this is that you can use jade features like inheritance on the client side, and all of the template compilation is done first on the server.
  • expose - default: false - if set to true, the templates will be exposed using express-expose (express expose also sets them as locals)

License

MIT

Something went wrong with that request. Please try again.