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

@ephemeral-broker/wdio

v0.1.3

Published

WebDriverIO service plugin for ephemeral-broker - share bootstrap data across parallel workers

Readme

@ephemeral-broker/wdio

npm version Tests License: MIT

WebDriverIO service plugin for @ephemeral-broker/core.

Share bootstrap data, tokens, and secrets across parallel WDIO workers without touching disk or opening ports.

Why?

When running WebDriverIO tests in parallel:

  • Problem: Each worker regenerates tokens, fetches bootstrap data, makes duplicate API calls
  • Solution: Generate once, share via ephemeral broker, workers read from in-memory store

Performance: 80x faster bootstrap (8s → 0.1s per worker)

Features

  • Zero disk I/O - All data stored in-memory via named pipes/UNIX sockets
  • Parallel-safe - No race conditions, each worker reads independently
  • Automatic cleanup - Broker stops when tests complete
  • TTL support - Data expires automatically
  • Secure - No ports opened, filesystem permissions only

Installation

npm install --save-dev @ephemeral-broker/wdio @ephemeral-broker/core

Quick Start

1. Add Service to WDIO Config

// wdio.conf.js
import { EphemeralBrokerService } from '@ephemeral-broker/wdio'

export const config = {
  services: [
    [EphemeralBrokerService, {
      ttl: 600000, // 10 minutes
      seedData: {
        cache: {
          courseId: 'COURSE_123',
          modeIds: { test: 'mode_1' }
        },
        ephemeral: {
          pubToken: 'Bearer abc123...',
          adminToken: 'Bearer xyz789...'
        }
      }
    }]
  ]
}

2. Access Data in Tests

// test/example.spec.js
import { Client } from '@ephemeral-broker/core'

describe('My Tests', () => {
  let client

  before(async () => {
    // Connect to broker (pipe path set by service)
    client = new Client(process.env.EPHEMERAL_PIPE)
  })

  it('should use shared bootstrap data', async () => {
    const courseId = await client.get('courseId')
    const token = await client.get('pubToken')

    console.log(`Using course: ${courseId}`)
    // ... test logic
  })
})

Configuration Options

{
  // Time-to-live for cached data (milliseconds)
  ttl: 600000, // Default: 10 minutes

  // Enable debug logging
  debug: false,

  // Bootstrap data to seed
  seedData: {
    // Persistent cache (from .cache files)
    cache: {
      courseId: 'COURSE_123',
      districtId: 'DISTRICT_456',
      // ... other bootstrap data
    },

    // Ephemeral secrets (never persisted)
    ephemeral: {
      pubToken: 'Bearer ...',
      adminToken: 'Bearer ...',
      // ... tokens, run metadata
    }
  }
}

How It Works

┌─────────────────────────────────────────────┐
│ WDIO Test Run                               │
│                                             │
│ 1. onPrepare: Start broker + seed data     │
│ 2. Spawn 5 parallel workers                │
│ 3. Workers read from broker (fast!)        │
│ 4. onComplete: Stop broker + cleanup       │
└─────────────────────────────────────────────┘

Named Pipe: /tmp/broker-abc123.sock
├── Worker 1 (reads tokens)
├── Worker 2 (reads tokens)
├── Worker 3 (reads tokens)
├── Worker 4 (reads tokens)
└── Worker 5 (reads tokens)

Advanced Usage

Load Cache from Files

import fs from 'fs'

const cache = JSON.parse(
  fs.readFileSync('data/.cache/satellite.qa.bootstrap.json', 'utf8')
)

export const config = {
  services: [
    [EphemeralBrokerService, {
      seedData: {
        cache: cache,
        ephemeral: {
          pubToken: await generateToken(),
          runId: Date.now().toString(36)
        }
      }
    }]
  ]
}

Custom Seeding in onPrepare

export const config = {
  services: [
    [EphemeralBrokerService, { ttl: 600000 }]
  ],

  onPrepare: async function (config, capabilities) {
    // Get service instance
    const brokerService = config.services.find(
      s => s[0] === EphemeralBrokerService
    )?.[1]

    // Seed custom data
    await brokerService.seed({
      cache: { customData: 'value' },
      ephemeral: { token: 'abc123' }
    })
  }
}

Integration with Smart Runner

This plugin was extracted from the smart-runner pattern used in content2class. See INTEGRATION.md for migrating from smart-runner to the plugin.

API

EphemeralBrokerService

Constructor Options

  • ttl (number): Time-to-live for cached data in milliseconds. Default: 600000 (10 minutes)
  • debug (boolean): Enable debug logging. Default: false
  • seedData (object): Bootstrap data to seed
    • cache (object): Persistent cache data
    • ephemeral (object): Ephemeral secrets (tokens, metadata)

Methods

  • seed(data): Seed broker with additional data
  • getWorkerEnv(): Get environment variables for workers

WDIO Hooks

  • onPrepare(): Starts broker before tests
  • onComplete(): Stops broker after tests

Environment Variables

Set automatically by the service:

  • EPHEMERAL_PIPE: Path to broker pipe (e.g., /tmp/broker-abc123.sock)
  • EPHEMERAL_BROKER_MODE: Set to 'true' when broker is active

Examples

See examples/ directory for complete working examples:

Related Projects

License

MIT © Kathy Wegrzynowski