single-file-cli 2.0.52 → 2.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "2.0.52";
1
+ export const version = "2.0.54";
package/options.js CHANGED
@@ -135,6 +135,7 @@ const OPTIONS_INFO = {
135
135
  "output-directory": { description: "Path to where to save files, this path must exist.", type: "string" },
136
136
  "version": { description: "Print the version number and exit.", type: "boolean" },
137
137
  "output-json": { description: "Output the result as a JSON string containing the page and network info", type: "boolean" },
138
+ "insert-single-file-comment": { description: "Insert a comment in the HTML header with the URL of the page", type: "boolean", defaultValue: true },
138
139
  };
139
140
 
140
141
  const { args, exit } = Deno;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-cli",
3
- "version": "2.0.52",
3
+ "version": "2.0.54",
4
4
  "description": "SingleFile CLI",
5
5
  "author": "Gildas Lormeau",
6
6
  "engines": {
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "type": "module",
12
12
  "bin": {
13
- "single-file": "./single-file-node.js"
13
+ "single-file": "single-file-node.js"
14
14
  },
15
15
  "dependencies": {
16
16
  "simple-cdp": "^1.8.5",
@@ -290,7 +290,12 @@ async function capturePage(options) {
290
290
  }
291
291
  return pageData;
292
292
  } catch (error) {
293
- const message = "URL: " + options.url + (options.errorTracesDisabled ? "" : "\nStack: " + error.stack) + "\n";
293
+ const date = new Date();
294
+ let message = `[${date.toISOString()}] URL: ${options.url}`;
295
+ if (!options.errorTracesDisabled) {
296
+ message += "\nStack: " + error.stack;
297
+ }
298
+ message += "\n";
294
299
  if (options.errorFile) {
295
300
  await writeTextFile(options.errorFile, message, { append: true });
296
301
  } else {