Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
[DEPRECATED] - Look instead at React
It was a fun to implement this, but now there are other significantly better solutions.
XJade is a new template engine which accelerates and simplifies building complex dynamic web interfaces in JavaScript. Write your GUI templates in shorthand declarative way and let XJade do the hard work for you.
XJade will generate well optimized code which uses native DOM methods like createElement(), setAttribute() or appendChild() to build parts of your GUI directly in client browser. Templates are compiled as a part of your build process and client will receive only generated code.
If you are developing a fat client, single page application or just need to generate HTML view of your data, XJade will save your time and make your code more maintainable. Take a look at this simple example screenshot from real project.
Check it out:
After installing the latest version of node, install with:
npm install -g xjade
Usage: xjade [options] [...files]
Options:
-h, --help output usage information
-V, --version output the version number
-c, --compile <kind> Specify compiler: 'js' (default), 'html' or 'ast'.
--doctype <str> Specify doctype: '5' (default), 'strict', 'transitional', 'xhtml' or other.
--data <str> Filename or string with input data input JSON format.
-p, --pretty Print pretty HTML.
Command line version outputs compiled templates to it's standard output. To save your templates to file use Redirection.
Althought XJade primary target is Browser, it's possible to use it on server side as static HTML files generator.
Set XJade compile
option to html
to compile and execute input file and all its includes to single HTML output.
Your input template must have exported render
function.
Data object (see XJade compiler options) will be passed as its first argument.
Use cases:
Example (index.xjade):
exports.render = function @template () {
html
head
script[src="app.js"]
link[href="style.css" rel="stylesheet" type="text/css"]
body
'This HTML was generated by XJade!'
};
Generate pretty formated HTML with:
xjade -c html -p index.xjade
MIT
Developing firts prototype of XJade was supported by MAINDATA.
Jade was first template engine I have used.
This project started as try to fix Jade's client side limitations. That's why it was named XJade.
Thanks to PEG.js for amazing parser generator.
Thanks to Blade for idea of forking Jade and using PEG.js.
Thanks to ist.js for idea of using DOM API directly rather then strings.
FAQs
XJade template engine
The npm package xjade receives a total of 3 weekly downloads. As such, xjade popularity was classified as not popular.
We found that xjade demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.