Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
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
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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.