
Security News
pnpm 11.10 Hardens Registry Authentication to Block Token Redirection
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.
bun-ffi-structs
Advanced tools
TypeScript struct-packing library for Bun and Node.js node:ffi workflows. Define and pack/unpack C-style structs with memory layout control for FFI calls.
.ptr propertybun install bun-ffi-structs
Using the package on Node.js currently requires node:ffi support to be enabled, for example with --experimental-ffi --allow-ffi on supported builds.
For local development, use scripts/link-dev.sh <target-project-root> to symlink this package into another project's node_modules.
See examples/README.md for runnable examples demonstrating various features.
import { defineStruct, defineEnum, allocStruct, objectPtr } from "./structs_ffi"
const ColorEnum = defineEnum({ RED: 0, GREEN: 1, BLUE: 2 })
const PositionStruct = defineStruct([
["x", "f32"],
["y", "f32"],
["z", "f32"],
])
const ObjectStruct = defineStruct([
["id", "u32"],
["position", PositionStruct],
["color", ColorEnum],
["count", "u32", { lengthOf: "items" }],
["items", ["u32"]],
])
const buffer: ArrayBuffer = ObjectStruct.pack({
id: 42,
position: { x: 1.0, y: 2.0, z: 3.0 },
color: "BLUE",
items: [10, 20, 30],
})
const unpacked = ObjectStruct.unpack(buffer)
// -> resolves to type {
// id: number
// position: { x: number, y: number, z: number }
// color: "RED" | "GREEN" | "BLUE"
// items: Iterable<number>
// count?: number | null | undefined
// }
FAQs
Unknown package
The npm package bun-ffi-structs receives a total of 293,235 weekly downloads. As such, bun-ffi-structs popularity was classified as popular.
We found that bun-ffi-structs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.

Security News
/Research
Socket uncovered 17 malicious npm and PyPI packages typosquatting Paysafe, Skrill, and Neteller SDKs to steal developer secrets.

Security News
Node.js is debating whether AI-driven security report volume warrants moving more vulnerability reports into public workflows.