Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
express-tsx
Advanced tools
当前版本不适合用于生产环境,因为测试不完善
/**@type {Express}*/
var app = expressTsx(viewsDir="/views",app=Express())
lang='en'
html语言配置title='express-tsx'
html标题keywords=''
html关键词description=''
html描述heads:string[]=[]
用以配置头部信息<script src=${requirejs.toUrl("requirejs")}></script>
引用requirejs
loading='loading html...'
在 requirejs
引用前写入div#app'
app挂载点<script src=${browserRenderJs}> imports_files:[${renderfile},...string[]]=[] </script>
使用浏览器配置脚本进行渲染foots:string[]=[]
用以放置统计脚本之类的{ cache:boolean }
来开关, 开启后将生成一个名为 ${id}.${renderfile}.${hash}
的html载体
id
是内置编译器编号renderfile
是被渲染的文件hash
是 JSON.stringify(data)
的 hash
值event-source
发送更新事件, 实现如下:
id
和 renderfile
参数(req,res)=>void
收到请求后, 找对应编译器的更新事件监听器, 监听事件,
就绪时时发送 { event
:ping }
收到更新事件时发送 { event:update, data:changefile }
requirejs
做的模块加载器, 所以配置都继承 requirejs
, 下面是需要额外说明的配置
transform=false
开启后, 在生产环境下 paths
配置中的 /node_modules/module/path
会被转换为 https://unpkg.com/module@version/path
callback
之类的不可序列化的配置是无效的 (比如不能被 JSON.stringify
转成字符串的属性)FAQs
express view engine to render tsx file
The npm package express-tsx receives a total of 6 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.