
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
WARNING: This is a work-in-progress port of then-jade to pug. Expect it to break at any time until this warning is removed. The documentation is not up to date.
Jade template engine with async/streaming support via promises and generators.
The Jade template engine is a templating engine with a 2 stage process :
localsthen-jade makes sure that the rendering stage of the process (stage 2) becomes asynchronous:
locals and the rendering will be progressive, waiting asynchronously for the resolution of the promisesIt is not the goal of then_jade to modify the compilation phase of the process (stage 1). This means for example that extends & includes will continue to be loaded synchronously by jade.
Note: jade was frozen and deprecated in version 1.11.0 because of trademark issues. It was replaced by pug which has a new code architecture. then-jade is currently frozen and creating a then-pug module is only a very low priority task for the maintainers.
npm install then-jade
Before all examples, you will need:
var thenJade = require('then-jade');
Compiles a string containing a jade template into a rendering function.
var fn = thenJade.compile(str, options);
The rendering function can be called as fn(locals, callback) where locals are the user defined variables or generator/promises that can be used in the template. callback is a node-style callback(err, res) that will be called with the rendered template once the rendering is finished or with an error if something went wrong.
For options, see the documentation for compileStreaming
Compiles a string containing a jade template into a rendering function.
var fn = thenJade.compileStreaming(str, options);
The rendering function can be called as fn(locals) where locals are the user defined variables or generator/promises that can be used in the template. The result of calling this function is a ReadableStream that will stream the rendered template.
str of jade.If the function is called with an optional node-style callback, the callback
will be called with the result when the rendering is finished.
Otherwise, the function will return a Promise that will be fulfilled when the rendering is finished.
Options:
filename filename required for include / extendsRender the given str of jade
options:
filename filename required for include / extendsoptions are used as locals at rendering time.
The result is a ReadableStream wrapping the asynchronous rendering of the template. This stream can be piped into a WritableStream.
Render the given path file containing a jade.
The compilation of the file is synchronous and uses an internal in-memory cache
to avoid re-compiling the same file twice.
The rendering is asynchronous.
If the function is called with an optional node-style callback, the callback
will be called with the result when the rendering is finished.
Otherwise, the function will return a Promise that will be fulfilled when the rendering is finished.
options are used as locals at rendering time.
Render the given path file containing a jade.
The compilation of the file is synchronous and uses an internal in-memory cache
to avoid re-compiling the same file twice.
The rendering is asynchronous.
The result is a ReadableStream wrapping the asynchronous rendering of the template. This stream can be piped into a WritableStream.
options are used as locals at rendering time.
MIT
FAQs
An async, streaming version of the pug templating language
The npm package then-pug receives a total of 57 weekly downloads. As such, then-pug popularity was classified as not popular.
We found that then-pug 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.