
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
This module lets you use Jade easily on the browser in an AMD environment - like RequireJS.
It provides:
npm install jade-amd
See the README.md file in the example folder. It contains a guided tour through all the moving parts.
These are the interesting bits:
The middleware is there for when you are developing. It intercepts requests for template js and compiles and serves the templates directly. This means that you don't need to make any changes to the browser-side code.
var jadeAmd = require('jade-amd');
app.use( '/js/templates/', jadeAmd.jadeAmdMiddleware({}) );
Jade ships with a runtime.js that lets you run precompiled templates on the client with out requiring the whole of the Jade templating system. Before Jade v0.31.0 this script needs to be wrapped to work with AMD loaders such as RequireJS. The following command wraps the runtime if needed, otherwise just passes it through unchanged.
# wrap Jade's runtime.js in AMD semantics
jade-amd --runtime > public/js/jadeRuntime.js
Goes through all the .jade files and compiles them to JavaScript, and then wraps them for AMD loaders. See the README.md and Makefile in the example folder for more details on how to integrate into your project.
# compile and wrap you templates
jade-amd --from views/ --to public/js/templates
Assuming that you have used RequireJS your browser JavaScript will now look something like this:
require([ 'templates/person' ], function(personTemplate) {
var rendered_content = personTemplate({ name: 'Joe Bloggs' });
});
And you can use exactly the same template on the server side!
FAQs
Helpers for working with Jade templates in an AMD setting
We found that jade-amd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.