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

checkmarx-api-client

v1.1.0

Published

TypeScript client for Checkmarx On-Premise REST API

Readme

checkmarx-api-client

CI npm version License: MIT

TypeScript client for the Checkmarx On-Premise REST API. Works in Node.js and the browser (isomorphic). Fully typed, zero runtime dependencies.


Installation

npm install checkmarx-api-client

Quick start

import { CheckmarxClient } from 'checkmarx-api-client';

const cx = new CheckmarxClient({
  apiUrl:  'https://checkmarx.example.com',
  apiPath: 'api',
  token:   'your-api-token',
});

API reference

Projects

// List all projects
const result = await cx.projects();
const result = await cx.projects({ limit: 50, name: 'my-app' });
const result = await cx.projects({ ids: 'uuid1,uuid2', tags: 'team:backend' });

result.projects            // CheckmarxProject[]
result.totalCount          // number
result.filteredTotalCount  // number

// Get a single project
const project = await cx.project('project-uuid');

// Get project branches
const branches = await cx.project('project-uuid').branches();
const branches = await cx.project('project-uuid').branches({ branchName: 'main' });
const branches = await cx.project('project-uuid').branches({ limit: 25, offset: 0 });

Scans

// List scans
const result = await cx.scans();
const result = await cx.scans({ 'project-id': 'project-uuid' });
const result = await cx.scans({
  'project-id': 'project-uuid',
  branch:       'main',
  status:       'Completed',
  limit:        25,
  offset:       0,
});

result.scans               // CheckmarxScan[]
result.totalCount          // number
result.filteredTotalCount  // number

Scan summary

// Get summary for one or more scans
const summaries = await cx.scanSummary({ 'scan-ids': 'scan-uuid-1,scan-uuid-2' });
const summaries = await cx.scanSummary({
  'scan-ids':               'scan-uuid',
  'include-queries':        true,
  'include-status-counters': true,
});

// summaries[0].sastCounters.highCounter
// summaries[0].scaCounters.totalCounter
// summaries[0].kicsCounters.mediumCounter

Reports

// Request a new report
const { reportId } = await cx.createReport({
  reportName: 'my-report',
  fileFormat: 'PDF',
  reportType: 'ui',
  data: {
    projectId:  'project-uuid',
    scanId:     'scan-uuid',
    branchName: 'main',
  },
});

// Download the report (returns ArrayBuffer — save to disk or stream)
const buffer = await cx.downloadReport(reportId);

Projects overview

// Overview across all projects
const result = await cx.projectsOverview();
const result = await cx.projectsOverview({
  'project-ids': 'uuid1,uuid2',
  'branch-name': 'main',
  limit:         50,
  offset:        0,
});

result.projectsOverviewItems   // CheckmarxProjectOverview[]
result.totalCount              // number
result.filteredTotalCount      // number

Chainable resource pattern

project(id) implements PromiseLike, so it can be awaited directly or chained to access sub-resources:

// Await directly → fetches the project
const project = await cx.project('project-uuid');

// Chain → fetches branches
const branches = await cx.project('project-uuid').branches({ branchName: 'main' });

Request events

Subscribe to every HTTP request for logging, monitoring, or debugging:

cx.on('request', (event) => {
  console.log(`[${event.method}] ${event.url} → ${event.statusCode} (${event.durationMs}ms)`);
  if (event.error) {
    console.error('Request failed:', event.error.message);
  }
});

The event object contains:

| Field | Type | Description | |---|---|---| | url | string | Full URL that was requested | | method | 'GET' \| 'POST' | HTTP method used | | startedAt | Date | When the request started | | finishedAt | Date | When the request finished | | durationMs | number | Duration in milliseconds | | statusCode | number \| undefined | HTTP status code, if a response was received | | error | Error \| undefined | Present only if the request failed |

Multiple listeners can be registered. The event is always emitted whether the request succeeded or failed.


Error handling

Non-2xx responses throw a CheckmarxApiError with the HTTP status code and status text:

import { CheckmarxApiError } from 'checkmarx-api-client';

try {
  await cx.project('nonexistent-uuid');
} catch (err) {
  if (err instanceof CheckmarxApiError) {
    console.log(err.status);     // 404
    console.log(err.statusText); // 'Not Found'
    console.log(err.message);    // 'Checkmarx API error: 404 Not Found'
    console.log(err.stack);      // full stack trace
  }
}

Authentication

The client uses Bearer token authentication. Pass your API key or JWT token directly:

const cx = new CheckmarxClient({
  apiUrl:  'https://checkmarx.example.com',
  apiPath: 'api',
  token:   'your-api-token',
});

TypeScript types

All domain types are exported:

import type {
  // Core
  CheckmarxClientOptions,
  RequestEvent,
  CheckmarxClientEvents,
  // Errors
  CheckmarxApiError,
  // Projects
  CheckmarxProject,
  ProjectsParams,
  // Branches
  CheckmarxBranch,
  BranchesParams,
  // Scans
  CheckmarxScan,
  CheckmarxScanStatus,
  CheckmarxScanStatusDetail,
  ScansParams,
  // Scan summary
  CheckmarxScanSummary,
  CheckmarxSastCounters,
  CheckmarxScaCounters,
  CheckmarxKicsCounters,
  ScanSummaryParams,
  // Reports
  CheckmarxReportRequest,
  CheckmarxReportFormat,
  CheckmarxReportData,
  CheckmarxReportResponse,
  CheckmarxReportStatus,
  CheckmarxReportStatusValue,
  // Projects overview
  CheckmarxProjectOverview,
  ProjectsOverviewParams,
} from 'checkmarx-api-client';

Documentation

Full API documentation is published at: https://eljijuna.github.io/CheckmarxApiClient


Contributing

See CONTRIBUTING.md.


License

MIT