Skip to main content
Deno 2 is finally here 🎉️
Learn more

Deno Foreign Function Interface (WIP & Need Help)

ci tag license

Deno Foreign Function Interface.

Example

import * as ffi from "https://deno.land/x/ffi/mod.ts";

type Fn0 = ffi.CFuntion<"int add(int, int)">; // ["add", ["i64", "i64"], "i64"]
type Fn1 = ffi.CFuntion<"int add(int)">;      // ["add", ["i64"], "i64"]
type Fn2 = ffi.CFuntion<"void hello(int)">;   // ["hello", ["i64"], "void"]
type Fn3 = ffi.CFuntion<"void hello()">;      // ["hello", [], "void"]
type Fn4 = ffi.CFuntion<"void hello(void)">;  // ["hello", ["void"], "void"]

License

denoffi is released under the MIT License. See the bundled LICENSE file for details.