
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
express-tsx
Advanced tools
这是 express 中 jsx 模板渲染的一个实现 .
它提供了两种渲染模式 , 一种 "静态渲染" , 一种 "服务器同构渲染"
调用 ReactDOM.renderToStaticMarkup
方法渲染 require('tsxmodule').default || require('tsxmodule')
import Express = require('express')
export const app = Express()
import { render } from "../";
app.engine('.tsx',render())
app.set('views',__dirname+'/views')
app.set('view engine','tsx')
app.get('/',(req,res)=>res.render('staticHTMLRender',{ who:'express-tsx', title:'express-tsx' }))
export default (props)=>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<title>{props.title}</title>
</head>
<body>
hello {props.who}
</body>
</html>
这个的实现就比较绕了 , 建议直接看 源码
import Express = require('express')
export const app = Express()
import { render } from "../";
app.engine('.tsx',render({ ssr:true }))
app.set('views',__dirname+'/views')
app.set('view engine','tsx')
app.get('/',(req,res)=>res.render('ssrRender',{ who:'express-tsx', title:'express-tsx' }))
export default (props)=>
<div onClick={ ()=>alert(props.who) }>
hello {props.who}
</div>
git clone https://github.com/shynome/express-tsx.git
npm install
npm test
FAQs
express view engine to render tsx file
The npm package express-tsx receives a total of 2 weekly downloads. As such, express-tsx popularity was classified as not popular.
We found that express-tsx 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.