
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.
jdf-extract-template
Advanced tools
将html中的前端模板抽取到js中
默认抽取带有ext-id属性的script标签,可以在config.json中设置prefix属性来改变它。
prefix指的是模板script标签的一个属性
{
"name": "jdf-extract-template",
"prefix": "channel-id"
}
在js中,目前只支持jQuery调用,形如:var tpl = $(selector).html()
selector不能是变量!~~
$('#id').html()
$('.class').html()
$('[]').html()
$(selector).html()
<div id="renderPlace">
<script type="text/template" ext-id="12" id="floorTpl">
<span>我是模板:${floor_id}</span>
</script>
</div>
define(function () {
require('module1');
var tpl = $("#floorTpl").html();
var data = {
floor_id: 1
}
$('#renderPlace').html(render(tpl, data))
})
经过插件编译后
<div id="renderPlace">
</div>
define(function () {
require('module1');
var tpl = '<span>我是模板:${floor_id}</span>';
var data = {
floor_id: 1
}
$('#renderPlace').html(render(tpl, data))
})
FAQs
extract template to js
We found that jdf-extract-template 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.