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

@evpanda/sdk

v0.0.1

Published

EVPanda SDK — passive OCPI/OCPP traffic capture for embedding in customer OCPI servers and OCPP CSMS.

Downloads

132

Readme

@evpanda/sdk

Build

Passive OCPI / OCPP traffic capture for Node. Embed it in your OCPI server or OCPP CSMS; it records protocol messages, buffers them in-process, and ships them in batches to the EVPanda ingestion API.

It never gets in your way. The SDK will not block your request path, throw into your handlers, crash your process, or grow memory unbounded. If it's under stress or the network is down it drops data — it never degrades your application.

  • Zero runtime dependencies. Dual ESM + CommonJS, typed.
  • Node ≥ 18.

Install

npm add @evpanda/sdk      # or: pnpm add @evpanda/sdk / bun add @evpanda/sdk

Quick start

import { EVPanda, OCPPEventType } from "@evpanda/sdk";

const sdk = EVPanda.start({
  endpoint: "https://ingest.evpanda.io",
  apiKey: process.env.EVPANDA_API_KEY!,
});

// OCPI message (e.g. from your inbound/outbound HTTP layer)
sdk.captureOCPI({
  direction: "inbound",
  identity: {
    platformId: "acme",
    platformName: "Acme Mobility",
    tenantId: "cpo-42", // tenant is all-or-nothing: both fields or neither
    tenantName: "CPO 42",
  },
  http: {
    method: "POST",
    url: "/ocpi/2.2/cdrs",
    statusCode: 200,
    requestHeaders: { "content-type": "application/json" },
    responseHeaders: {},
    truncated: false,
  },
});

// OCPP message (e.g. from your WebSocket CSMS)
sdk.captureOCPP({
  eventType: OCPPEventType.Message,
  identity: { chargerId: "CP-001" },
  connectionId: "conn-abc",
  payload: new TextEncoder().encode('[2,"id","BootNotification",{}]'),
  truncated: false,
});

// On shutdown — flushes whatever is buffered, within the drain deadline.
process.on("SIGTERM", () => void sdk.close());

captureOCPI / captureOCPP are non-blocking and never throw — they buffer and return immediately. Delivery happens in the background.

Identity

Every message must carry an identity; the SDK validates it and silently drops messages it can't attribute (it never throws back at you).

  • OCPI → RoamingIdentity: platformId + platformName required.
  • OCPP → ChargerIdentity: chargerId required.
  • tenantId + tenantName are optional but all-or-nothing — supply both or neither.

Identity is per message, not global config — one process can serve many platforms, tenants and chargers.

Configuration

EVPanda.start(config) — only endpoint and apiKey are required.

| Option | Default | Description | |-------------------|-------------|--------------------------------------------------------------------| | endpoint | — | Ingestion API base URL (https://…). | | apiKey | — | Sent as X-API-Key. | | bufferCapacity | 10000 | Max buffered messages. Oldest are dropped when full. | | maxCaptureBytes | 65536 | Per-body capture cap (bytes). | | flushInterval | 5000 | Max ms between flushes (also flushes early when the buffer fills). | | drainTimeout | 10000 | Max ms close() waits to drain remaining messages. | | compression | "gzip" | "gzip" or "zstd" (zstd needs the optional @mongodb-js/zstd). | | debug | false | Master log switch. Silent unless true. | | logger | console | Optional logger; only used when debug is true. |

A bad config never crashes your boot — the SDK falls back to an inert no-op instead of throwing.

Behavior

  • Batched delivery. Messages flush when the buffer fills or on flushInterval, whichever comes first.
  • Backpressure = drop-oldest. If the upstream is slow/down, the buffer caps at bufferCapacity and discards the oldest messages. Your app is never blocked or back-pressured.
  • Secret redaction. Authorization, X-API-Key and Cookie headers are stripped before anything is buffered.
  • Resilient transport. Bounded retry with backoff on 5xx/network; permanent rejections (400/401/413) are dropped without retry storms.
  • Graceful shutdown. await sdk.close() flushes what's buffered within drainTimeout, then stops. Idempotent.
  • Compression. gzip by default; "zstd" if you install the optional @mongodb-js/zstd peer (transparent gzip fallback if absent).