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

@venn-lang/load

v0.6.0

Published

The load namespace: describe a load profile, run it, assert on the metrics.

Readme

@venn-lang/load

The load namespace: describe a load profile, run it, assert on the metrics.

Three builders turn a sentence about traffic into a profile value, and a fourth verb hands that profile to the LoadRunner port and gives you back latency percentiles and an error rate. The profile is plain data, so a flow can hold it, pass it and read it before anything is driven.

Install

Nothing to install. @venn-lang/load is part of the standard library, and the CLI and the language server both load @venn-lang/stdlib, which lists every stdlib plugin. A file reaches the namespace with one line.

import { load } from "venn/load"

Usage

module demo.load

import { load } from "venn/load"
import { assert } from "venn/assert"

flow "Checkout under load" {
  step "ramp to 200 VUs" {
    const profile = load.ramp 0 200 { over: "30s", hold: "5m" }
    const metrics = load.run profile

    expect metrics.p95 < 800
    expect metrics.errorRate < 0.05
  }
}

Verbs

| Verb | Call | Result | | --- | --- | --- | | load.ramp | load.ramp 0 200 { over: "30s", hold: "5m" } | load.Ramp | | load.constant | load.constant 50 { over: "10s" } | load.Constant | | load.spike | load.spike 500 { at: "5s" } | load.Spike | | load.run | load.run profile | load.Metrics |

The three builders are pure: they compute a descriptor and touch nothing. Only load.run reaches the port.

load.ramp takes two positional arguments, the virtual users it starts from and the number it ends at. The spec's 0 -> 200 arrow sugar is not in the grammar.

Durations are written as strings. over, hold and at are read by the SDK's Duration schema, which accepts "30s", "2m" or a plain count of milliseconds and yields milliseconds. The language's own 30s unit literal is a different value, and passing it is refused before the run with "over" is not a valid option. Write { over: "30s" } or { over: 30000 }.

The types it publishes

| Type | Shape | | --- | --- | | load.Ramp | { kind: "ramp", from, to, over?, hold? } | | load.Constant | { kind: "constant", vus, over? } | | load.Spike | { kind: "spike", peak, at? } | | load.Profile | Whichever of the three a builder produced. This is what load.run takes. | | load.Metrics | { vus, rps, p50, p95, p99, errorRate } |

The durations inside a profile are numbers, not durations: Duration already turned "30s" into 30000 on the way in, so what a profile holds is a count of milliseconds.

The LoadRunner port

| | | | --- | --- | | id | venn.port.load-runner | | version | 1 | | requires | net | | methods | run |

Two implementations ship together, which is what makes this a port rather than a module with a good interface:

  • createFakeLoadRunner() derives canned metrics from the profile's peak VUs, with no real traffic. This is the one @venn-lang/stdlib binds, so a load flow is runnable offline.
  • createRealLoadRunner() is a stub. Every call throws a VennError with code VN8090, because this repository is the language and drives no real load.

Both run the same conformance suite, loadRunnerConformance in src/runner/load-runner.suite.ts, which holds them to two invariants: p50 <= p95 <= p99, and the reported vus is the profile's peak.

API

| Export | What it is | | --- | --- | | loadPlugin | The plugin definition: namespace load, requires: ["net"]. Also the default export. | | rampProfile({ from, to, over?, hold? }) | Builds a RampProfile. | | constantProfile({ vus, over? }) | Builds a ConstantProfile. | | spikeProfile({ peak, at? }) | Builds a SpikeProfile. | | peakVus(profile) | The peak concurrent VUs a profile reaches, which is what a runner drives toward. | | RampProfile, ConstantProfile, SpikeProfile | The three descriptor types. | | LoadProfile | Their union: what the runner consumes. | | LoadRunnerPort | The port descriptor. | | LoadRunner | The port interface: run(profile). | | createFakeLoadRunner() | The fake runner. | | createRealLoadRunner() | The real runner, stubbed to throw VN8090. | | LoadMetrics | The metrics type. | | LoadMetricsSchema | The Zod schema registered as the plugin's nominal LoadMetrics type. |

Binding a different runner means one entry in the runner's port list:

import { createFakeLoadRunner, LoadRunnerPort } from "@venn-lang/load";
import { createRunner } from "@venn-lang/runtime";

const runner = createRunner({
  host,
  plugins,
  sink,
  uri,
  ports: [{ port: LoadRunnerPort, impl: createFakeLoadRunner() }],
});

See also