
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
html-inject-script
Advanced tools
Transform stream for injecting script tags into html.
var injectScripts = require('html-inject-script')
process.stdin
.pipe( injectScripts(['./app.js', './extra.js']) )
.pipe( process.stdout )
input:
<html><head></head><body>hello</body></html>
output:
<html><head><script src="./app.js"></script><script src="./extra.js"></script></head><body>hello</body></html>
require('html-inject-script')(scripts[, opts])Injects an array of scripts. Accepts an object of options:
selector (string, default: 'head'): A hyperstream selector into which the tags are injectedprepend (boolean, default: true): If true, prepends. If false, appends.cat index.html | htmlinjectscript "app.js" > output.html
usage: cat index.html | htmlinjectscript "app.js" > output.html
Options:
--body -b, inject into the body element (default: head)
--selector -s, override head or body with a specific selector
--append -a, append to selector instead (default: prepend)
--help, -h display this message
requires the tag (head, body, or otherwise) to be present in the src.
FAQs
Transform stream for injecting script tags into html.
The npm package html-inject-script receives a total of 3,328 weekly downloads. As such, html-inject-script popularity was classified as popular.
We found that html-inject-script 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.