Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jade-client-connect

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jade-client-connect

Jade Client Connect - A compiler to help use templates on a web client

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

#Jade Client Connect This is a piece of Middleware for the connect framework. It can be plugged into Connect servers or Express servers and expose a URL to the client which will have as a javascript file all of the compiled templates.

##How to use Copy Git repository into your project run 'npm install -d'

###In your connect server file

app = require('connect').createServer();
app.use(require('./jade-client-connect/')(__dirname + "/views"));

###On the client

<script src="/scripts/templates.js"></script>
<script>
  // Assuming you have a file named content.jade in the views folder
  var html = tpl.content({ title: "Hello World" });
</script

##Defaults & Options

var options = {
  ns : 'tpl'
}
app.use(require('./jade-client-connect/')(__dirname+"/views", options));

The src option is the folder that contains all of the jade templates. Each of the files inside this directory will be compiled as a javascript jade template in the ns client namespace. By default the namespace is tpl so all teplates will be accessed by calling something like tpl.footer(). Only one file will be sent back to the client.

##Running Tests & Compiling Source

cake build
cake test

FAQs

Package last updated on 13 Sep 2011

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