remove vulnerable node deps, cleanup

This commit is contained in:
Harvey Tindall
2021-11-14 14:50:40 +00:00
parent 4da1c8c2b6
commit 9092f42834
8 changed files with 2026 additions and 2568 deletions
+35
View File
@@ -0,0 +1,35 @@
// equiv to npx inline-source --root data data/crash.html out-cli.html
const { inlineSource } = require('inline-source');
const fs = require('fs');
const path = require('path');
if (process.argv.length < 4) {
console.log(`Usage
${process.argv[0]} ${process.argv[1]} [root <rootdir>] in.html out.html`);
process.exit(1);
}
let htmlpath = path.resolve(process.argv[2]);
let root = path.resolve('.');
let out = path.resolve(process.argv[3]);
if (process.argv[2] == 'root') {
root = path.resolve(process.argv[3]);
htmlpath = path.resolve(process.argv[4]);
out = path.resolve(process.argv[5]);
}
inlineSource(htmlpath, {
compress: true,
rootpath: root,
}).then((html) => {
fs.writeFile(out, html, (err) => {
if (err) {
console.log("Failed:", err);
process.exit(1);
}
});
}).catch((err) => {
console.log("Failed:", err);
process.exit(1);
});