Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-inject-html-cli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-inject-html-cli - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

index.js
#!/usr/bin/env node
const fs = require('fs');
const { exit } = require("process")
const glob = require("glob")
const inject = require('node-inject-html').default

@@ -21,3 +22,4 @@ const argv = require('yargs')

const injectHtml = async () => {
const files = argv._.length ? argv._ : [argv.file]
console.log(argv._, argv.f)
const files = argv._.length ? argv._ : glob.sync(argv.file)
files.forEach(file => {

@@ -24,0 +26,0 @@ const html = fs.readFileSync(file, "utf8")

{
"name": "node-inject-html-cli",
"version": "0.0.1",
"version": "0.0.2",
"description": "A CLI interface for the node-insert-html library",

@@ -20,2 +20,3 @@ "main": "index.js",

"dependencies": {
"glob": "^7.1.6",
"node-inject-html": "0.0.5",

@@ -22,0 +23,0 @@ "yargs": "^16.2.0"

@@ -14,7 +14,7 @@ # node-inject-html-cli

// Inject a script to index.html
$ inject-html -f index.html --headStart='<script src="https://someanalyticsfunction.com"></script>'
$ inject-html -f index.html --headStart="<script src='https://someanalyticsfunction.com'></script>"
```
```
// Add a meta tag to all .html files
$ inject-html -f **/*.html --headEnd='<meta name="viewport" content="width=device-width, initial-scale=1">'
$ inject-html -f **/*.html --headEnd="<meta name='viewport' content='width=device-width, initial-scale=1'>"
```

@@ -26,7 +26,7 @@

// Inject a script to index.html
$ npx node-inject-html-cli -f index.html --headStart='<script src="https://someanalyticsfunction.com"></script>'
$ npx node-inject-html-cli -f index.html --headStart="<script src='https://someanalyticsfunction.com'></script>"
```
```
// Add a meta tag to all .html files
$ npx node-inject-html-cli -f **/*.html --headEnd='<meta name="viewport" content="width=device-width, initial-scale=1">'
$ npx node-inject-html-cli -f **/*.html --headEnd='<meta name='viewport' content='width=device-width, initial-scale=1'>"
```

@@ -33,0 +33,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc