
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
A command line utility to inject meta tags into an html file or to remove code based on conditions.
Written because I could not find a command-line equivalent that could work with npm scripts instead of gulp.
This module injects meta tags between markers placed in an html file or removes code between markers. It can take a json file which will be transformed to strings and injected. It removes code between markers so you can for example remove livereload code which is not needed in a production environment. It can also inject the current git commit hash into the HTML as a comment so it is easily visible which commit is currently deployed.
This module was written in ES6 and requires node >= 4.0.0.
Place the markers in your html file to inject or remove code:
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- inject:meta -->
<meta name="devmeta" content="This meta will be replaced">
<!-- endinject -->
</head>
<body>
content
</body>
</html>
<!-- inject:git-hash -->
The meta tags will be injected between the markers and the meta that are already there will be removed.
Options:
-h, --help output usage information
-V, --version output the version number
-i, --input <input> Input file
-o, --output <output> Output file (defaults to input when omitted)
-r, --remove <remove> Remove condition
-H, --hash Inject git hash of current commit
Given a meta.json file:
{
"meta": [{
"name": "testmeta",
"content": "Example content"
},{
"name": "testmeta2",
"content": "Example content 2"
}]
}
injectmeta -i index.html -o dist/index.html -m meta.json
will result in the file dist/index.html
:
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<meta name="testmeta" content="Example content">
<meta name="testmeta2" content="Example content 2">
</head>
<body>
</body>
</html>
<!-- b64f022ae51d87a411c4608f403f3216ee028d03 -->
Notice that the code
<!-- remove:production -->
<script src="http://localhost:35729/livereload.js?snipver=1"></script>
<!-- endremove -->
has been removed.
The comment
<!-- inject:git-hash -->
has been replaced by the git hash of the current commit.
FAQs
A command line utility to inject meta tags into an html file or to remove code based on conditions.
The npm package injectmeta receives a total of 2 weekly downloads. As such, injectmeta popularity was classified as not popular.
We found that injectmeta 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
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.