
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Stop transpiling React components for Node with JSX templates, which use native es6 tagged template literals
Build JSX using native ES6 templates. No transpiling required for Node.js and modern browsers.
npm i jsx-tmpl --save
Just use the jsx
tagged template literal and write normal HTML markup inside native ES6 templates.
const { jsx } = require('jsx-tmpl');
const Greeting = require('./Greeting');
const React = require('react');
class App extends React.PureComponent {
render() {
return jsx`
<div class="App">
<Greeting name="John Doe" />
</div>
`(React, { Greeting }); // Pass in React, and a hash of components used
}
}
For dynamic props or rendering variables, use standard ES6 template interpolation:
const { jsx } = require('jsx-tmpl');
const Greeting = require('./Greeting');
const React = require('react');
class App extends React.PureComponent {
render() {
let name = "John Doe";
return jsx`
<div class="App">
<Greeting name=${name} />
</div>
`(React, { Greeting }); // Pass in React, and a hash of components used
}
}
Since React is passed in as a parameter to the resulting render function, you can substitute it for Preact, or any other virtual DOM library or React-compatible framework.
const { jsx } = require('jsx-tmpl');
const Preact = require('preact');
class App extends Preact.Component {
render() {
let name = "John Doe";
return jsx`
<div class="App">
Hell World!
</div>
`(Preact); // Pass in Preact instead of React!
}
}
FAQs
Stop transpiling React components for Node with JSX templates, which use native es6 tagged template literals
The npm package jsx-tmpl receives a total of 0 weekly downloads. As such, jsx-tmpl popularity was classified as not popular.
We found that jsx-tmpl 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.