@screenshotscout/cli 0.6.0 → 0.7.0

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/README.md CHANGED
@@ -178,9 +178,10 @@ The CLI writes response data unchanged, without adding labels or summaries.
178
178
  | ------------------- | ----------------------------------------------- | --------------------------------------- | ----------------------------------------------- |
179
179
  | Binary image or PDF | Saves `screenshot.<extension>` | Saves exact response bytes to the path | Writes exact response bytes to standard output |
180
180
  | Markdown | Writes the Markdown to standard output | Saves the Markdown to the path | Writes the Markdown to standard output |
181
+ | HTML | Writes the HTML to standard output | Saves the HTML to the path | Writes the HTML to standard output |
181
182
  | JSON | Writes the raw JSON response to standard output | Saves the raw JSON response to the path | Writes the raw JSON response to standard output |
182
183
 
183
- Binary, Markdown and JSON writes to standard output add no line break.
184
+ Binary, Markdown, HTML and JSON writes to standard output add no line break.
184
185
 
185
186
  For an automatically named binary response, the extension comes only from the actual response `Content-Type`: `.png`, `.jpg`, `.webp`, `.gif`, `.tiff`, or `.pdf`. A missing or unrecognized content type uses `.bin`; a requested format does not determine the automatic filename.
186
187
 
package/dist/result.js CHANGED
@@ -8,11 +8,13 @@ const DEFAULT_CAPTURE_RESULT_IO = {
8
8
  /** Save or display one successful SDK capture response without transforming it. */
9
9
  export async function writeCaptureResult(response, outputPath, io = DEFAULT_CAPTURE_RESULT_IO) {
10
10
  const bytes = response.kind === "binary" ? response.bytes : response.rawResponse.body;
11
- // JSON and Markdown are text, so without an output path they go to standard output.
11
+ // JSON, Markdown and HTML are text, so without an output path they go to standard output.
12
+ const mediaType = mediaTypeOf(response.rawResponse.contentType);
12
13
  if (outputPath === "-" ||
13
14
  (outputPath === undefined &&
14
15
  (response.kind === "json" ||
15
- mediaTypeOf(response.rawResponse.contentType) === "text/markdown"))) {
16
+ mediaType === "text/markdown" ||
17
+ mediaType === "text/html"))) {
16
18
  await io.writeStandardOutput(bytes);
17
19
  return;
18
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screenshotscout/cli",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Official command-line interface for the Screenshot Scout screenshot API.",
5
5
  "type": "module",
6
6
  "bin": {