single-file-cli 2.0.54 → 2.0.56

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.54";
1
+ export const version = "2.0.56";
package/options.js CHANGED
@@ -132,6 +132,7 @@ const OPTIONS_INFO = {
132
132
  "extract-data-from-page": { description: "Extract compressed data from the page instead of fetching the page in order to create universal self-extracting HTML files", type: "boolean", defaultValue: true },
133
133
  "prevent-appended-data": { description: "Prevent appending data after the compressed data when creating self-extracting HTML files", type: "boolean" },
134
134
  "embed-screenshot": { description: "Embed a screenshot of the page as a PNG file in the compressed file (self-extracting HTML or ZIP file). When enabled, the resulting file can be read as a ZIP file or a PNG image.", type: "boolean" },
135
+ "embedded-image": { description: "Path to a PNG image to embed in the compressed file.", type: "string" },
135
136
  "output-directory": { description: "Path to where to save files, this path must exist.", type: "string" },
136
137
  "version": { description: "Print the version number and exit.", type: "boolean" },
137
138
  "output-json": { description: "Output the result as a JSON string containing the page and network info", type: "boolean" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-cli",
3
- "version": "2.0.54",
3
+ "version": "2.0.56",
4
4
  "description": "SingleFile CLI",
5
5
  "author": "Gildas Lormeau",
6
6
  "engines": {
@@ -26,7 +26,7 @@ import { closeBrowser } from "./lib/browser.js";
26
26
  import { Deno } from "./lib/deno-polyfill.js";
27
27
  import options from "./options.js";
28
28
 
29
- const { readTextFile, exit, addSignalListener } = Deno;
29
+ const { readTextFile, readFile, exit, addSignalListener } = Deno;
30
30
 
31
31
  try {
32
32
  addSignalListener("SIGTERM", closeBrowserAndExit);
@@ -83,6 +83,9 @@ async function run() {
83
83
  }
84
84
  options.httpHeaders = headers;
85
85
  }
86
+ if (options.embeddedImage) {
87
+ options.embeddedImage = Array.from(await readFile(options.embeddedImage));
88
+ }
86
89
  options.retrieveLinks = true;
87
90
  const singlefile = await initialize(options);
88
91
  await singlefile.capture(urls);