Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@chainsafe/bun-ffi-z

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainsafe/bun-ffi-z

A Bun-FFI library for Zig projects

latest
npmnpm
Version
1.1.4
Version published
Weekly downloads
1.7K
86%
Maintainers
1
Weekly downloads
 
Created
Source

bun-ffi-z

Library to use and publish shared libraries for bun:ffi.

Usage

  • Add bun-ffi-z dependency
bun install @chainsafe/bun-ffi-z
  • Add bun-ffi-z section to package.json
  "bun-ffi-z": {
    "name": "example",
    "targets": [
      "linux-x64-gnu",
      "linux-arm64-gnu",
      "linux-x64-musl",
      "linux-arm64-musl",
      "darwin-x64",
      "darwin-arm64",
      "win32-x64"
    ],
    "zigCwd": "zig",
    "zigExportFiles": [
      "src/root.zig"
    ]
  }
  • Use bun-ffi-z to generate the bun ffi binding
bun-ffi-z generate-binding
  • Build shared library for native host
bun-ffi-z build
  • On publish CI, prepare an "artifacts" subdirectory which contains all prebuilt binaries
  - name: Download all artifacts
    if: ${{ steps.release.outputs.release_created }}
    uses: actions/download-artifact@v4
    with:
      path: artifacts
  • Prepare targetPackages subdirectory by copying prebuilt binaries inside "artifacts" folder prepared above
bun-ffi-z prepublish --artifacts artifacts

Note that both targetPackages and artifacts are relative to bun folder.

  • Publish the root package and all target packages prepared above in targetPackages subdirectory
bun-ffi-z publish

License

MIT

FAQs

Package last updated on 29 Sep 2025

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