
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.
Jadeite is a Jade-like template language, and it's actually valid JavaScript.
Feedbacks are welcome!
Unstable, use at your own risk
This package uses the (old) Proxy API,
so you need v0.11 node (and --harmony flags) or a harmony enabled browser..
With npm do
$ npm install jadeite
Write your template function:
function myTemplate(magic) {
with(magic) { // `with` is needed if you want to omit property access
return html
(head
(title
('Welcome on my Awesome site!')
)
(script(type = 'text/javascript', src = '/bundle.js') //very named arguments :o
)
)
(body
(h1
(a(href = link) // wow, so dynamic attributes!
(linkText) // such dynamic content
)
(input()) // empty tag, function call needed, or it will be substituted with the `input` variable
(iff(cond)
('true!')
)
)
);
}
}
Compile it, and it's ready to use:
var jadeite = require('jadeite');
var template = jadeite(myTemplate);
console.log(template({
link: '/home',
linkText: 'Hello world!'
}));
// <html><head><title>Welcome on my Awesome site!</title><script type="text/javascript" src="/bundle.js" /></head><body><h1><a href="/home">Hello world!</a><input /></h1></body></html>
fn is a template function that accepts one parameter, like in the example. It return the compiled template, the example (myTemplate) will compile to this:
function(data) {
var a = [];
a.push('<html><head><title>Welcome on my Awesome site!</title><script type="text/javascript" src="/bundle.js" /></head><body><h1><a href="');
a.push(data.link);
a.push('">');
a.push(data.linkText);
a.push('</a><input />');
if(data.cond) {
a.push('true!');
}
a.push('</h1></body></html>');
return a.join('');
}
each(item in items)(li(item))jadeite < input.js commandMIT
FAQs
Jade-like template library
The npm package jadeite receives a total of 2 weekly downloads. As such, jadeite popularity was classified as not popular.
We found that jadeite 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
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.