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.
js-template
Advanced tools
Rewritten and Improved John Resig's micro javascipt template
js-template is based on John Resig's microTemplate function. However the orinal version has got to be improved.
npm install js-template
var jsTemplate = require('js-template');
var templateHtml = "Hello <b><%= world %></b>";
var data = {world: "You!!"};
var output = jsTemplate(templateHrml, data);
console.log(output); // Hello <b>You!!</b>
<div id="<%= id %>" class="<%=(i % 2 == 1 ? "even" : "")%>">'
<div class="grid_1 alpha right">
<img class="righted" src="<%= profileImageUrl %>"/>
</div>
<div class="grid_6 omega contents">
<a href="/<%= fromUser %>"><%= fromUser %></a>
</div>
</div>
<% for (var i = 0; i < users.length; i++) { %>
<a href="<%=users[i].url%>"><%= users[i].name %></a>
<% } %>
{
id: 'myid',
i: 11,
profileImageUrl: 'myurl',
fromUser: 'me',
users: [
{name: "John", url: "john.com"},
{name: "Jane", url: "jane.com"}
]
};
<div id="myid" class="even">
<div class="grid_1 alpha right">
<img class="righted" src="myurl"/>
</div>
<div class="grid_6 omega contents">
<a href="/me">me</a>:</b>
</div>
</div>
<a href="john.com">John</a>
<a href="jane.com">Jane</a>
<div>
<%= include("spec/test-include.html", data) %>
</div>
{
users: [
{name: "John", url: "john.com"},
{name: "Jane", url: "jane.com"}
]
};
<div>
<a href="john.com">John</a>
<a href="jane.com">Jane</a>
</div>
FAQs
Rewritten and Improved John Resig's micro javascipt template
The npm package js-template receives a total of 1,243 weekly downloads. As such, js-template popularity was classified as popular.
We found that js-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
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.