Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

a-template

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-template

Simple Template Engine

  • 0.6.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

a-template.js

Simple Template Engine used for gulp-generator

example

<script id="search" type="text/template">
   <input type="text" data-bind="search" data-action-input="update">
   <ul>
       <!-- BEGIN result:loop -->
       <li>{name}-{id}</li>
       <!-- END result:loop -->
   </ul>
</script>
<script>
var list = new aTemplate({
templates:["search"],
data:{
   search:"",
   list:[
       {name:"tomomi",id:0},
       {name:"daigo",id:1112},
       {name:"taro",id:11113},
       {name:"koike",id:1114},
       {name:"aboki",id:1115},
       {name:"tetsuro",id:1116},
       {name:"takahashi",id:1117},
       {name:"suzuki",id:1118},
       {name:"okazaki",id:1119},
       {name:"aoi",id:1120},
   ],
   result:function(){
       var search = this.data.search;
       var list = this.data.list;
       return list.filter(function(str){
	   var id = str.id+"";
	   return str.name.indexOf(search) >= 0 || id.indexOf(search) >= 0;
       });
   }
},
}).update();
</script>

FAQs

Package last updated on 03 Feb 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc