
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.
Use it in your favourite packaging tool.
var React = require('react');
var jact = require('jade-react-compiler');
// Compile to code
var js = jact.compileClient('p foobar');
/* Output:
module.exports = function () {
return React.DOM.p(null, 'foobar');
};
*/
// Compile to function
var fn = jact.compile('p foobar');
var Component = React.createClass({ render: fn });
var markup = React.renderComponentToStaticMarkup(new Component());
/* Output:
<p>foobar</p>
*/
If there are more than one root nodes, only the last statement is returned. Same for block statements.
Using forEach in code instead of the each block will output
nothing (forEach returns nothing).
Filters, mixins, cases and other things not yet implemented.
Inteded to be used as part of a compilation toolchain and not
optimized for production use. Compile the files to JavaScript first,
then require() them as usual.
requireThere is a special case for using require that will hoist the
declaration to the top of the generated CommonJS module:
Jade:
- const MyComponent = require('components/my-component')
div
if MyComponent
MyComponent This is a custom component.
else
| No component!
Generated JavaScript:
var MyComponent = require("components/my-component");
module.exports = function() {
return React.DOM.div(null, MyComponent ? MyComponent(null, "This is a custom component.") : "No component!");
};
Example using the command line tool:
$ ./bin/jade-react-compiler.js -cP <<EOL
> - const MyComponent = require('components/my-component')
> div
> if MyComponent
> MyComponent This is a custom component.
> else
> | No component!
> EOL
var MyComponent = require("components/my-component");
module.exports = function() {
return React.DOM.div(null, MyComponent ? MyComponent(null, "This is a custom component.") : "No component!");
};
React considers values of false to be empty, so they won't be rendered.
If you render a naked text node without a parent node, it will be wrapped in
a <span>.
render()
function for use with React.MIT
FAQs
Jade compiler for Facebook React
We found that jaect 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.