Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
ljs-template
Advanced tools
Derived from EJS Embedded Javascript Templates with new expressions for lighter templates
npm install ljs-template --save
var ljs = require('ljs-template');
var out = ljs.render("Hello {{_name_}}", {name: "Max"});
console.log(out);
Hello Max
var template = `
<h1>Books:</h1>
{#each books as book #}
<h2>{{_book.title_}}</h2>
<ul>
<li>Authors:
{#if book.authors #}
<ul>
{#each book.authors as author #}
<li>{{_author_}}</li>
{/each/}
</ul>
{/if/}
</li>
<li>Price: {{_book.price_}}
</ul>
{/each/}
`;
var data =
{
books: [
{
title: "Cravings: Recipes for All the Food You Want to Eat",
authors: ["Chrissy Teigen", "Adeena Sussman"],
price: "$17.85"
},
{
title: "Pretty Happy: Healthy Ways to Love Your Body",
authors: ["Kate Hudson"],
price: "$15.89"
}
]
}
var ljs = require('ljs-template');
var out = ljs.render(template, data);
console.log(out);
<h1>Books:</h1>
<h2>Cravings: Recipes for All the Food You Want to Eat</h2>
<ul>
<li>Authors:
<ul>
<li>Chrissy Teigen</li>
<li>Adeena Sussman</li>
</ul>
</li>
<li>Price: $17.85
</ul>
<h2>Pretty Happy: Healthy Ways to Love Your Body</h2>
<ul>
<li>Authors:
<ul>
<li>Kate Hudson</li>
</ul>
</li>
<li>Price: $15.89
</ul>
{%
[javascript]
%}
{#var [variable] = [javascript] #}
{{_[variable]_}}
{#if [condition] #}
{/else/}
{/if/}
{#each [map] as [value], [key] #}
{/each/}
{#each [array] as [value], [index] #}
{/each/}
FAQs
Lighter Javascript Templates
The npm package ljs-template receives a total of 1 weekly downloads. As such, ljs-template popularity was classified as not popular.
We found that ljs-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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
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.