npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@omgqa/reporter-sdk

v0.1.0

Published

Shared JUnit-XML builder + ingestion client for OMGQA test reporters (Jest/Vitest, Cypress, …).

Readme

@omgqa/reporter-sdk

Shared building blocks for OMGQA test reporters. It is the seed factored out of the @omgqa/cypress-reporter inline helpers, so every JS reporter (Jest/Vitest, Cypress, …) produces an identical wire format and shares retry/error behaviour.

It gives you two things:

  1. A Surefire-style JUnit document builder (buildJUnitXml) with strict XML escaping.
  2. OmgqaClient — an HTTP client that publishes a run to the OMGQA ingestion API, with retry on transient failures and clear, status-carrying errors.

Install

npm install --save-dev @omgqa/reporter-sdk

Requires Node >= 18 (uses the global fetch).

Quick start

const { OmgqaClient } = require('@omgqa/reporter-sdk');

const client = new OmgqaClient({
  baseUrl: process.env.OMGQA_URL,        // e.g. https://api.omgqa.app
  apiKey: process.env.OMGQA_API_KEY,     // omg_...  (Agent role: testruns:write + findings:create)
  projectId: process.env.OMGQA_PROJECT_ID,
  mode: 'import',                         // 'import' (default, single call) or 'api'
  ci: { branch: 'main', commit: 'abc123', environment: 'ci' },
});

// Normalized results: outcome is one of 'Passed' | 'Failed' | 'Skipped'.
const summary = await client.publish([
  { name: 'adds numbers', suite: 'math', outcome: 'Passed', durationMs: 12 },
  { name: 'breaks', suite: 'math', outcome: 'Failed', errorMessage: 'Expected 1\n  at math.test.js:7' },
  { name: 'pending', suite: 'math', outcome: 'Skipped' },
]);
// summary -> { stored, failures, findingsCreated, findingsReopened, ... }

Or build the client from environment variables (returns null when unconfigured, so reporters can fail soft):

const { clientFromEnv } = require('@omgqa/reporter-sdk');
const client = clientFromEnv({ suiteName: 'jest' });
if (client) {
  await client.publish(results);
}

The normalized result shape

Every reporter maps its native results into this shape before calling the SDK:

| Field | Type | Notes | | --- | --- | --- | | name | string (required) | Full test name → <testcase name> | | outcome | 'Passed' \| 'Failed' \| 'Skipped' (required) | | | suite | string? | Logical suite/describe → classname (falls back to file, then tests) | | file | string? | Source file | | durationMs | number? | Wall-clock ms (rendered as seconds) | | errorMessage | string? | Failure message + stack (Failed only) |

Modes

mode: 'import' (default) renders the results as a JUnit document and makes one call:

| Step | Call | | --- | --- | | Import run | POST /api/v1/projects/{projectId}/test-runs/import?format=junit |

CI context (branch, commit, environment, ciUrl) is appended as query params.

mode: 'api' uses the granular endpoints and sends native OMGQA outcomes:

| Step | Call | | --- | --- | | Create run | POST /api/v1/projects/{projectId}/test-runs | | Register results (bulk, idempotent) | POST /api/v1/test-runs/{runId}/results | | Complete run | POST /api/v1/test-runs/{runId}/complete |

Auth in both modes: Authorization: Bearer omg_….

Reliability

  • Retry: network errors and 429/5xx responses are retried (default 3 attempts) with exponential backoff (retryBaseMs * 2^n). 4xx (other than 429) is not retried.
  • Timeout: each request is aborted after timeoutMs (default 30s).
  • Errors: failures throw an OmgqaError carrying .status and a trimmed .body.

API

| Export | Purpose | | --- | --- | | OmgqaClient | The ingestion client (.publish(results), .isConfigured()). | | OmgqaError | Error with .status / .body. | | buildJUnitXml(results, { suiteName }) | Render normalized results as JUnit XML. | | xmlEscape(value) / stripInvalidXmlChars(value) | XML helpers. | | clientFromEnv(overrides, env) | Build a client from env vars (or null). | | ciFromEnv(env) | Read CI context (GitHub Actions defaults). | | logSummary(logger, summary) | Print the standard one-line summary. | | OUTCOME | { Passed, Failed, Skipped }. |

Tests

node --test

Covers the JUnit builder (escaping, failure/skip rendering, classname fallbacks, empty list) and the client (request shaping, CI query params, api-mode flow, retry/backoff, non-retryable 4xx).