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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bunbox/vk

v0.1.2

Published

Vulkan module for Bunbox using Bun FFI

Downloads

21

Readme

@bunbox/vk

Vulkan bindings for Bun using FFI.

Installation

bun add @bunbox/vk

Features

  • ✨ Complete Vulkan 1.0 - 1.3 API coverage
  • 🚀 Direct FFI bindings for maximum performance
  • 📦 Organized by API version for easy navigation
  • 🔧 Type-safe struct definitions using @bunbox/struct
  • 🎯 Platform-specific functions (Win32, X11, Wayland, Metal)
  • 🛠️ Utility functions for version handling and common operations

Structure

The package is organized into several modules:

Enums

Vulkan enumerations organized by API version:

  • enums/vk10.ts - Vulkan 1.0 enumerations
  • enums/vk11.ts - Vulkan 1.1 additions
  • enums/vk12.ts - Vulkan 1.2 additions
  • enums/vk13.ts - Vulkan 1.3 additions

Structs

Vulkan structure definitions organized by API version:

  • structs/vk10.ts - Vulkan 1.0 structures
  • structs/vk11.ts - Vulkan 1.1 additions
  • structs/vk12.ts - Vulkan 1.2 additions
  • structs/vk13.ts - Vulkan 1.3 additions

Functions

Vulkan functions organized by category:

  • functions/global.ts - Global-level functions (e.g., vkGetInstanceProcAddr)
  • functions/instance-vk10.ts - Instance-level functions
  • functions/device-vk10.ts - Device-level functions (memory, sync, etc.)
  • functions/resources-vk10.ts - Resource management (buffers, images, commands)

Platform Functions

Platform-specific Vulkan functions:

  • Windows: Win32 surface creation
  • Linux: X11 (Xlib/XCB) and Wayland surface creation
  • macOS: Metal surface creation

Callbacks

Vulkan callback function signatures for:

  • Memory allocation callbacks
  • Debug callbacks
  • Device memory report callbacks

Utils

Utility functions for:

  • Version number creation and parsing
  • Common constants (API versions, special values)
  • Result checking and error messages
  • C string conversion

Usage

import { VK } from '@bunbox/vk';
import {
  VkResult,
  VkStructureType,
  vkApplicationInfo,
  vkInstanceCreateInfo,
  makeVersion,
  VK_API_VERSION_1_0,
} from '@bunbox/vk';

// Create application info
const appInfo = vkApplicationInfo({
  sType: VkStructureType.APPLICATION_INFO,
  pNext: 0n,
  pApplicationName: 'My Vulkan App',
  applicationVersion: makeVersion(1, 0, 0),
  pEngineName: 'My Engine',
  engineVersion: makeVersion(1, 0, 0),
  apiVersion: VK_API_VERSION_1_0,
});

// Create instance
const instanceCreateInfo = vkInstanceCreateInfo({
  sType: VkStructureType.INSTANCE_CREATE_INFO,
  pNext: 0n,
  flags: 0,
  pApplicationInfo: /* pointer to appInfo */,
  enabledLayerCount: 0,
  ppEnabledLayerNames: 0n,
  enabledExtensionCount: 0,
  ppEnabledExtensionNames: 0n,
});

// Call Vulkan functions
const result = VK.vkCreateInstance(/* ... */);

API Organization

The Vulkan API is extensive. To make it manageable, this package organizes the API into:

  1. By Version: Enums and structs are separated by Vulkan version (1.0, 1.1, 1.2, 1.3)
  2. By Category: Functions are grouped by their purpose (global, instance, device, resources)
  3. By Platform: Platform-specific extensions are in their own module

This organization makes it easier to find what you need and understand which API version introduced specific features.

License

MIT

Contributing

Contributions are welcome! This package aims to provide complete Vulkan API coverage while maintaining good organization and TypeScript type safety.