Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
content-inject-plugin
Advanced tools
a plugin for html-webpack-plugin,which can inject static file content into html page
a plugin for html-webpack-plugin,which can inject static file content into html page
var ContentInjectPlugin = require('./plugins/contentInjectPlugin');
new ContentInjectPlugin({
contents:{
content: 'this is inject content',
rem: function(){
return fs.readFileSync('./src/static/js/rem.js',{encoding:'utf8'});
},
other: 'other file content'
},
replaceMode: 'all',
memo: true
})
in template
<!DOCTYPE html>
<html lang="en">
<head>
<title>template</title>
<meta charset="utf-8">
<meta name="hotcss" content="design-width=750">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<script>
{{{__rem__}}}
</script>
<script>
{{{__other__}}}
</script>
</head>
<body>
<div id="app">
</div>
{{{__other__}}}
</body>
</html>
Parameter | Type | Default | Options | Description |
---|---|---|---|---|
contents | array | the content's array, which key used by tag in template, like {{{__key__}}} , support function to get content | ||
replaceMode | string | all | all,first | replace all matches or the first match |
memo | boolean | memorize the content or not |
In tempalte, content tag, which want to inject into head, must use legal tag like
FAQs
a plugin for html-webpack-plugin,which can inject static file content into html page
We found that content-inject-plugin 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.