Recount
Node.js

Image spans

Attach images to a Node.js trace, shown inline in the Recount dashboard.

Use type: 'image' to attach an image to a span. The dashboard renders the image inline if the URL loads successfully, and falls back to a clickable link if it does not.

Basic usage

recount.addSpan('image', 'Generated image', {
  output: { url: 'https://...', label: 'Profile photo' },
  durationMs: 1200
});

Input and output

Both input and output accept an image. Use whichever makes sense for your step: input for an image passed into a processing step, output for a generated result.

recount.addSpan('image', 'Resize image', {
  input: { url: 'https://.../original.png', label: 'Original' },
  output: { url: 'https://.../resized.png', label: 'Resized 400×300' },
  durationMs: 85
});

Fields

FieldTypeDescription
urlstringPublicly accessible image URL. Rendered inline; falls back to a link if it fails to load.
labelstringOptional label shown above the image.

Types

import type { ImageSpanData } from '@refactorlabs/recount';
type ImageSpanData = {
  url: string;
  label?: string;
};

On this page