
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
gulp-inline-template
Advanced tools
Inline template into js file as string or function.
use __inline(filePath) to inline template to js file as string (Only relative path support);
use __template(filePath) to inline ejs template to js file as function (Only relative path support);
<!-- content.tpl -->
<ul class="ul">
<% for(var i=0;i<list.length;i++) { %>
<li><%=list[i]%></li>
<% } %>
</ul>
var a = __inline("./content.tpl")
var b = __template("./content.tpl")
//after compile:
var a = "<ul class=\"ul\">\n\t<% for(var i=0;i<list.length;i++) { %>\n\t<li><%=list[i]%></li>\n\t<% } %>\n</ul>\n";
var b = function(data,escape
/**/) {
escape = escape || function (markup) {
return markup == undefined
? ''
: String(markup)
.replace(_MATCH_HTML, encode_char);
};
var _ENCODE_HTML_RULES = {
"&": "&"
, "<": "<"
, ">": ">"
, '"': """
, "'": "'"
}
, _MATCH_HTML = /[&<>'"]/g;
function encode_char(c) {
return _ENCODE_HTML_RULES[c] || c;
};
;
var __output = [], __append = __output.push.bind(__output);
; __append("<ul class=\"ul\">\n ")
; for(var i=0;i<data.list.length;i++) {
; __append("\n <li>")
; __append(escape(data.list[i]))
; __append("</li>\n ")
; }
; __append("\n</ul>\n")
return __output.join("");
}
FAQs
Inline template into js file as string or function.
The npm package gulp-inline-template receives a total of 15 weekly downloads. As such, gulp-inline-template popularity was classified as not popular.
We found that gulp-inline-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
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.