You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

bun-webgpu

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-webgpu

Native WebGPU implementation for Bun runtime

latest
Source
npmnpm
Version
0.1.6
Version published
Weekly downloads
132K
-10.28%
Maintainers
1
Weekly downloads
 
Created
Source

bun-webgpu

WebGPU (Dawn) FFI bindings for Bun.

Usage

import { setupGlobals } from 'bun-webgpu';

setupGlobals();

const adapter = navigator.gpu.requestAdapter();
const device = await adapter?.requestDevice();

// ... use WebGPU ...

Find out more about WebGPU types here.

Building

Note: There are prebuilt binaries in the pipeline artifacts.

Prerequisites

  • Bun: Ensure you have BunJS installed. (https://bun.sh)
  • Zig: The native components of this library are written in Zig. Ensure Zig is installed and available in your PATH. (https://ziglang.org/learn/getting-started/)
  • Pre-built Dawn Libraries: This project relies on pre-built Dawn libraries.

Building the FFI Liberary

The package.json includes scripts to build the native library components.

  • build:dev
  • build:prod

Conformance Test Suite (CTS)

To run the CTS, build the library first, then run the tests:

./run-cts.sh 'webgpu:api,operation,adapter,requestDevice:always_returns_device:*'

Run all webgpu tests for example with ./run-cts.sh 'webgpu:*'

Current results for webgpu:api,* are:

** Summary **
Passed  w/o warnings = 39994 / 51160 =  78.17%
Passed with warnings =     0 / 51160 =   0.00%
Skipped              =  8290 / 51160 =  16.20%
Failed               =  2876 / 51160 =   5.62%

Testing

To run tests, build the library first, then run the tests:

bun test

Keywords

webgpu

FAQs

Package last updated on 24 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts