New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

connect-jade-html

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-jade-html

Simple connect middleware to serve Jade files as HTML

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status

connect-jade-html

It provide a simple Connect middleware to serve Jade without locals variables as template HTML files.

This project was created after the drop of native support for Jade in latest Express. More specifically, Express droped the compiler middleware in its versions 2 and 3 (the current versions at the time of this writing).

Read the [annoucement article][annoucement] for more information.

Installation

Using npm:

npm install connect-jade-html

Usage

Function returning a Connect middleware with the given options.

Options

  • self Use a self namespace to hold the locals (false by default)
  • locals Local variable defaults object
  • filename Used in exceptions, and required when using includes
  • debug Outputs tokens and function body generated
  • compiler Compiler to replace jade's default
  • compileDebug When false no debug instrumentation is compiled
  • pretty Add pretty-indentation whitespace to output (false by default)

Basic example

Here we will setup the middleware with only the required src option.

var jade = require('connect-jade-html');
var connect = require('connect');

var app = connect();

app.use(jade({
  src: __dirname,
  pretty: true
}));

app.use(connect.static(__dirname + '/public'));

app.listen(3000)

Advanced example

Pass the middleware to Connect, grabbing "*.jade" files from this directory and saving .html files to ./public. Also supplying our custom compile function.

Following that we have a static() layer setup to serve the .html files generated by Jade.

var connectJadeHtml = require('connect-jade-html');
var connect = require('connect');

var app = connect();

app.use(connectJadeHtml({
  src: __dirname,
  dest: __dirname + '/public',
  debug: true
}));

app.use(connect.static(__dirname + '/public'));

Contributors

Keywords

FAQs

Package last updated on 23 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc