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.
lit-nunjucks
Advanced tools
Compile https://mozilla.github.io/nunjucks/ templates into standar lit-html.
Install the library
npm install lit-nunjucks
const { compile } = require('lit-nunjucks')
Givend the input
{% if authorized %}
Hello {{customer.name}}
{% endif %}
It will generate
function template({
authorized
}) {
return authorized && html`Hello ${customer.name}`;
}
Templates are backend tecnologies, Usually sever renders a template once with a given values. If use a template into a full front end app, everytime our data state change we have to re apply the template. This behaviout is costly and there are such a good alternatives there in order to performatly update the DOM with a new state (React, Vue, lit-html).
window
lit-html lets you write HTML templates in JavaScript, then efficiently render and re-render those templates together with data to create and update DOM. https://lit-html.polymer-project.org/
You've been looking for a more sophisticated templating engine for JavaScript. https://mozilla.github.io/nunjucks/
This project attempts to bring best of both worlds. Use jinja style templates into a front end app performatly.
Probably you don't.
FAQs
Nunjucks compiler to lit-html
The npm package lit-nunjucks receives a total of 5 weekly downloads. As such, lit-nunjucks popularity was classified as not popular.
We found that lit-nunjucks 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
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.