
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
requirejs-underscore-tpl
Advanced tools
RequireJS underscore-tpl, Loads and precompile underscore templates
underscore-tpl is a RequireJS plugin to load and precompile Underscore.js templates.
Here are some performance tests that show the difference when rendering precompiled templates.
Use the tpl!
prefix when loading a template.
myview.js
define(['tpl!mytemplate.tpl'], function (template) {
var MyView = Backbone.View.extend({
template: template // just pass in the template
}); // do not use _.template(), at this point it is already compiled
return MyView;
});
The plugin will compile the template after requirejs r.js
optimizer.
And also when developing, it will compile the template the first time is loaded so that the next time is required it will just render the template saving a function call to underscore's internal render method.
You can pass underscoreTemplateSettings to RequireJS config
requirejs.config({
config: {
underscoreTemplateSettings: {
interpolate: /\{\{\s*([^#\{]+?)\s*\}\}/g, // {{ title }}
evaluate: /\{\{#([\s\S]+?)\}\}/g, // {{# console.log("stuff") }}
escape: /\{\{\{([\s\S]+?)\}\}\}/g // {{{ title }}}
}
});
For this plugin to work you need:
See LICENSE
FAQs
RequireJS underscore-tpl, Loads and precompile underscore templates
The npm package requirejs-underscore-tpl receives a total of 13 weekly downloads. As such, requirejs-underscore-tpl popularity was classified as not popular.
We found that requirejs-underscore-tpl 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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.