node-inject-html-cli
Advanced tools
Comparing version 0.0.1 to 0.0.2
#!/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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3659
39
3
+ Addedglob@^7.1.6
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)