Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bun-types

Package Overview
Dependencies
Maintainers
0
Versions
687
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-types - npm Package Compare versions

Comparing version 1.1.28-canary.20240913T140515 to 1.1.28-canary.20240914T140507

60

ffi.d.ts

@@ -605,2 +605,62 @@ /**

/**
* **Experimental:** Compile ISO C11 source code using TinyCC, and make {@link symbols} available as functions to JavaScript.
*
* @param options
* @returns Library<Fns>
*
* @example
* ## Hello, World!
*
* JavaScript:
* ```js
* import { cc } from "bun:ffi";
* import hello from "./hello.c" with {type: "file"};
* const {symbols: {hello}} = cc({
* source: hello,
* symbols: {
* hello: {
* returns: "cstring",
* args: [],
* },
* },
* });
* // "Hello, World!"
* console.log(hello());
* ```
*
* `./hello.c`:
* ```c
* #include <stdio.h>
* const char* hello() {
* return "Hello, World!";
* }
* ```
*/
function cc<Fns extends Record<string, FFIFunction>>(options: {
/**
* File path to an ISO C11 source file to compile and link
*/
source: string | import("bun").BunFile | URL;
/**
* Library names to link against
*
* Equivalent to `-l` option in gcc/clang.
*/
library?: string[] | string;
/**
* Include directories to pass to the compiler
*
* Equivalent to `-I` option in gcc/clang.
*/
include?: string[] | string;
/**
* Map of symbols to load where the key is the symbol name and the value is the {@link FFIFunction}
*/
symbols: Fns;
}): Library<Fns>;
/**
* Turn a native library's function pointer into a JavaScript function

@@ -607,0 +667,0 @@ *

2

package.json
{
"version": "1.1.28-canary.20240913T140515",
"version": "1.1.28-canary.20240914T140507",
"name": "bun-types",

@@ -4,0 +4,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc