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

@stanterprise/protobuf

v0.0.21

Published

Generated Protobuf code

Readme

@stanterprise/protobuf

TypeScript protobuf definitions and RPC service stubs for the Test System domain (attachments, events, observer service, and test entities). Generated code targets both ESM and CJS using tsup.

NOTE: The currently committed generated TypeScript sources do not fully match the proto definitions under protobuf/testsystem/v1/** (naming & package/version differences). See "Schema Status" below. This will be aligned in upcoming steps.

Contents

  • Generated message & enum types (lib/*.ts)
  • gRPC / protobuf-ts style service client & service descriptors
  • Proto source files (versioned) in protobuf/testsystem/v1/**
  • Build tooling via tsup

Installation

npm install @stanterprise/protobuf

Quick Usage

This package supports multiple flexible import patterns; see the examples below for details.

Basic Usage

// Pattern 1: Full namespace
import { testsystem } from "@stanterprise/protobuf";
const run = new testsystem.v1.entities.TestCaseRun();

// Pattern 2: Version-level
import { v1 } from "@stanterprise/protobuf/testsystem";
const run = new v1.entities.TestCaseRun();

// Pattern 3: Module-level
import { entities } from "@stanterprise/protobuf/testsystem/v1";
const run = new entities.TestCaseRun();

// Pattern 4: Individual class
import { TestCaseRun } from "@stanterprise/protobuf/testsystem/v1/entities";
const run = new TestCaseRun();

Encoding / Decoding Messages

Encoding / decoding a message (protobuf-ts runtime):

import { Attachment } from "@stanterprise/protobuf";
import { WireType, BinaryWriter, BinaryReader } from "@protobuf-ts/runtime";

const a = Attachment.create({
  name: "log.txt",
  mimeType: "text/plain",
  content: new Uint8Array([1, 2, 3]),
});
// Encode
const writer = new BinaryWriter();
Attachment.internalBinaryWrite(a, writer, { writeUnknownFields: false });
const bytes = writer.finish();
// Decode
const decoded = Attachment.internalBinaryRead(
  new BinaryReader(bytes),
  bytes.length,
  { readUnknownField: false }
);

Calling an RPC (unary) with a transport implementation:

import {
  TestEventCollectorClient,
  TestStartEvent,
} from "@stanterprise/protobuf";
import { GrpcTransport } from "@protobuf-ts/grpc-transport"; // example transport

const transport = new GrpcTransport({
  host: "https://observer.example.com",
});

const client = new TestEventCollectorClient(transport);

const call = client.reportTestStart({
  testId: "T-123",
  testName: "Sample test",
  metadata: { browser: "chrome" },
});

call.response.then((resp) => {
  console.log("Ack:", resp);
});

Schema Status (Current Divergences)

| Aspect | Proto (protobuf/testsystem/v1) | Generated TS (lib) | Divergence | | -------------- | -------------------------------- | ---------------------- | ------------------------------ | ------------- | | Package paths | testsystem.v1.* | testsystem.* | Missing v1 in generated code | | Event messages | *EventRequest suffix | TestStartEvent, etc. | Name suffix removed | | Ack message | AckResponse w/ error_code | Ack (no error_code) | Field & name mismatch | | Attachment | oneof payload { content | uri } | Single content bytes field | Oneof missing | | Entities | TestSuite has id | No id field present | Field missing |

These will be reconciled in a future regeneration step. Until then the published package reflects the generated TS API, not the proto sources.

Regeneration (Planned Standard)

Planned one-generator approach (protobuf-ts):

mkdir -p lib
protoc \
	--plugin=./node_modules/.bin/protoc-gen-ts_proto \
	--ts_out lib \
	--ts_opt long_type_string,optimize_code_size \
	--proto_path ./protobuf \
	$(git ls-files 'protobuf/testsystem/v1/**/*.proto')
node scripts/gen-index.js

The exact command will be updated once the generator set is trimmed and version pinning strategy finalized.

Versioning Policy

  • Patch: Non-breaking regeneration (comments, doc, internal tooling changes)
  • Minor: Additive schema changes (new optional fields, new messages, new RPC methods)
  • Major: Breaking schema changes (renames, removed fields/messages, package path changes)

Design Notes

  • Dual ESM/CJS build via tsup for Node + bundlers.
  • Externalized protobuf runtime libraries to keep package lean.
  • Auto-generated lib/index.ts consolidates exports (watch for accidental surface expansion if helper files are added).

Roadmap (Short Term)

  1. Align generated code with v1 proto packages & names
  2. Implement Attachment.payload oneof correctly
  3. Drop unused generator dependencies (ts-proto, ts-protoc-gen, etc.)
  4. Add exports map and remove prepare generation hook
  5. Introduce linting + formatting + CI regeneration verification
  6. Document RPC transport setup examples

Contributing

  1. Install deps: npm install
  2. (Temporary) Generated code is committed; do NOT run npm run generate until after divergence plan is executed.
  3. Open PRs referencing which proto changes (if any) they rely on.

License

MIT