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

bun-webview-parallel

v0.0.3

Published

Process-isolated Bun.WebView factory for running independent Chrome-backed WebViews in parallel.

Readme

bun-webview-parallel

Process-isolated Bun.WebView instances for applications that need multiple independent Chrome-backed WebViews at the same time.

Bun's Chrome WebView backend currently shares one Chrome process across WebViews created inside one Bun process, and WebView construction is main-thread-only. bun-webview-parallel uses explicit Bun subprocesses as the concurrency isolation boundary and exposes asynchronous WebView proxies over Bun IPC.

Install

bun add bun-webview-parallel

Basic use

import { createParallelWebViewFactory } from 'bun-webview-parallel'

const factory = createParallelWebViewFactory()

const [a, b] = await Promise.all([
  factory.create({
    backend: { type: 'chrome', url: false },
    dataStore: 'ephemeral',
    headless: true,
  }),
  factory.create({
    backend: { type: 'chrome', url: false },
    dataStore: 'ephemeral',
    headless: true,
  }),
])

console.log(a.hostPid, b.hostPid) // distinct active helper processes

await Promise.all([a.close(), b.close()])
await factory.close()

Optional host pooling

0.0.2 can reuse helper processes between sequential leases:

const factory = createParallelWebViewFactory({
  pool: true,
})

const first = await factory.create(options)
const pid = first.hostPid
await first.close() // reset + release

const second = await factory.create(options)
console.log(second.hostPid === pid) // true when reset/reuse succeeds

Pooling is disabled by default. pool: true uses the basic context-reset policy before a helper is returned to the idle pool. If reset fails, the helper is destroyed rather than reused.

Concurrent leases remain process-isolated: the pool never hands one helper to two active views.

The one-off convenience API createParallelWebView() stays dedicated/process-per-view because there is no retained factory to own idle pooled hosts.

Basic reset scope

The current basic reset clears known-origin browser storage, local/session storage, cookies, HTTP cache, and permissions before reuse. It is intentionally an explicit policy layer rather than pretending to be native Chrome BrowserContext disposal.

See Pooling and context reset for the exact contract and limitations.

Proxy surface

The proxy implements the asynchronous WebView surface needed by browser tooling:

  • navigate()
  • evaluate()
  • cdp()
  • click()
  • type()
  • press()
  • resize()
  • screenshot()
  • addEventListener() / removeEventListener() for CDP events
  • close()

Values crossing the process boundary must be structured-cloneable. The package does not attempt to proxy arbitrary native handles or synchronous object identity from the child process.

Isolation contract

Factories expose:

factory.isolation === 'process'
factory.isolatedSessions === true

The package does not schedule test work or decide worker counts. Callers decide concurrency; the package supplies isolated WebView leases.

Tests

bun run test:conformance

The suite covers process isolation, event forwarding, lifecycle, raw same-host reopen, and pooled same-host reuse with context clearing.

See Architecture, Pooling, and Testing.