Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
a-template
Advanced tools
#a-template.js
Simple Template Engine used for gulp-generator
##example
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>list sample</title>
</head>
<body>
<script id="list_template" type="text/template">
<ul>
<li><input type="text" data-bind="newItem"><button data-action="addItem()">追加</button></li>
<!-- BEGIN list:loop -->
<li>{name}[addMr]<button data-action="removeItem({i})">削除</button></li>
<!-- END list:loop -->
</ul>
</script>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="../aTemplate.js"></script>
<script>
var list = new aTemplate.View({
templates:["list_template"],
data:{
list:[
{name:"tomomi"},
{name:"daigo"},
{name:"taro"},
{name:"koike"}
]
},
method:{
removeItem:function(i){
this.data.list.splice(i,1);
this.update();
},
addItem:function(){
console.log(this.data.newItem);
this.data.list.push({name:this.data.newItem});
this.update();
}
},
convert:{
addMr:function($txt){
return "Mr."+$txt;
}
}
});
list.update();
</script>
</body>
</html>
FAQs
Simple Template Engine
The npm package a-template receives a total of 686 weekly downloads. As such, a-template popularity was classified as not popular.
We found that a-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.