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

@isl-lang/runtime-adapters

v0.1.1

Published

Runtime adapters for Fastify, Express, and Fetch to capture traces for verification

Downloads

11

Readme

Runtime Adapters for Verification

Runtime adapters for Fastify, Express, and Fetch to capture traces for verification with shipgate verify.

Overview

This package provides simple, one-line adapters that intercept HTTP requests/responses and capture traces in the format required for temporal and coverage analysis. Traces are automatically collected and can be exported for use with shipgate verify.

Features

  • Fastify adapter - Plugin that intercepts requests/responses
  • Express adapter - Middleware for Express apps
  • Fetch adapter - Wrapper for outbound HTTP calls
  • Trace collection - Automatic trace storage for verification
  • One-line wiring - Simple integration

Installation

pnpm add @isl-lang/runtime-adapters

Quick Start

Fastify

import Fastify from 'fastify';
import { fastifyVerificationAdapter } from '@isl-lang/runtime-adapters/fastify';

const fastify = Fastify();

// One line of adapter wiring
await fastify.register(fastifyVerificationAdapter, {
  domain: 'Auth',
  behaviorExtractor: (req) => `${req.method} ${req.url}`,
});

fastify.post('/api/login', async (request, reply) => {
  // Your handler logic
  return { success: true };
});

Express

import express from 'express';
import { expressVerificationMiddleware } from '@isl-lang/runtime-adapters/express';

const app = express();

// One line of adapter wiring
app.use(expressVerificationMiddleware({
  domain: 'Auth',
  behaviorExtractor: (req) => `${req.method} ${req.path}`,
}));

app.post('/api/login', (req, res) => {
  // Your handler logic
  res.json({ success: true });
});

Fetch

import { createVerificationFetch } from '@isl-lang/runtime-adapters/fetch';

const fetchWithVerification = createVerificationFetch({
  domain: 'Auth',
  behaviorExtractor: (url, options) => `fetch ${options?.method || 'GET'} ${url}`,
});

// Use instead of global fetch
const response = await fetchWithVerification('https://api.example.com/users', {
  method: 'GET',
});

Verification

After wiring the adapter, traces are automatically collected. Export them for verification:

import { getCollector } from '@isl-lang/runtime-adapters';

// Export traces
const { traces, events } = getCollector().export();

// Or verify directly
// shipgate verify --spec auth.isl --impl server.ts

API Reference

Fastify Adapter

interface FastifyVerificationOptions {
  domain: string;
  behaviorExtractor?: (req: FastifyRequest) => string;
  correlationIdExtractor?: (req: FastifyRequest) => string;
  captureRequestBody?: boolean;
  captureResponseBody?: boolean;
  ignorePaths?: string[];
  shouldTrace?: (req: FastifyRequest) => boolean;
}

await fastify.register(fastifyVerificationAdapter, options);

Express Adapter

interface ExpressVerificationOptions {
  domain: string;
  behaviorExtractor?: (req: Request) => string;
  correlationIdExtractor?: (req: Request) => string;
  captureRequestBody?: boolean;
  captureResponseBody?: boolean;
  ignorePaths?: string[];
  shouldTrace?: (req: Request) => boolean;
}

app.use(expressVerificationMiddleware(options));

Fetch Adapter

interface FetchVerificationOptions {
  domain: string;
  behaviorExtractor?: (url: string, options?: RequestInit) => string;
  correlationIdExtractor?: (options?: RequestInit) => string;
  captureRequestBody?: boolean;
  captureResponseBody?: boolean;
  ignoreUrls?: string[];
  shouldTrace?: (url: string, options?: RequestInit) => boolean;
}

const fetchWithVerification = createVerificationFetch(options);

Trace Collector

import { getCollector } from '@isl-lang/runtime-adapters';

const collector = getCollector();

// Get all traces
const traces = collector.getTraces();

// Get traces for a domain
const authTraces = collector.getTracesForDomain('Auth');

// Get events for a handler
const loginEvents = collector.getEventsForHandler('Login');

// Export for verification
const exported = collector.export();

// Get coverage statistics
const coverage = collector.getCoverage();

// Clear all traces
collector.clear();

Example

See examples/fastify-sample/ for a complete example:

cd examples/fastify-sample
pnpm start
# Server runs on http://localhost:3000

# In another terminal:
shipgate verify --spec auth.isl --impl server.ts

Security

By default, the adapters:

  • Do not capture request/response bodies (set captureRequestBody/captureResponseBody to true if needed)
  • Redact sensitive fields (password, token, secret, etc.)
  • Limit body size to 1024 bytes
  • Filter authorization headers

License

MIT