Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ffi-rs

zhangyuang29.2kMIT1.3.0TypeScript support: included

A module written in Rust and N-API provides interface (FFI) features for Node.js

ffi, rust, node.js, napi

readme

ffi-rs

A module written in Rust and N-API provides interface (FFI) features for Node.js

Description

ffi-rs is a high-performance module with small binary size written in Rust and N-API that provides FFI (Foreign Function Interface) features for Node.js. It allows developers to call functions written in other languages such as C++, C, and Rust directly from JavaScript without writing any C++ code.

This module aims to provide similar functionality to the node-ffi module but with a completely rewritten underlying codebase. The node-ffi module has been unmaintained for several years and is no longer usable, so ffi-rs was developed to fill that void.

Features

  • High performance ✨
  • Small binary size
  • Better type hints 🧐
  • Simpler data description and API interface 💗
  • Support more different data types between Node.js and C 😊
  • Support modifying data in place 🥸
  • Provide many ways to handle pointer type directly 🐮
  • Support running ffi task in a new thread 🤩️
  • Support output errno info 🤔️
  • No need to use ref to handle pointer 🤫

Benchmark

$ node bench/bench.js
Running "ffi" suite...
Progress: 100%

  ffi-napi:
    2 028 ops/s, ±4.87%     | slowest, 99.24% slower

  ffi-rs:
    318 467 ops/s, ±0.17%   | fastest

Finished 2 cases!
  Fastest: ffi-rs
  Slowest: ffi-napi

How to sponsor me

There are two ways to sponsor me both Alipay and WeChat

Eth address: 0x87a2575a5d4dbD5f965e3e3a3d20641BC9a5d192

Changelog

See CHANGELOG.md

Ecosystem

abstract-socket-rs

Install

$ npm i ffi-rs

Supported Types

Currently, ffi-rs only supports these types of parameters and return values. However, support for more types may be added in the future based on actual usage scenarios.

Basic Types

Reference Types

C++ Class

If you want to call a C++ function whose argument type is a class, you can use the pointer type. See tutorial

Supported Platforms

Note: You need to make sure that the compilation environment of the dynamic library is the same as the installation and runtime environment of the ffi-rs call.

  • darwin-x64
  • darwin-arm64
  • linux-x64-gnu
  • linux-x64-musl
  • win32-x64-msvc
  • win32-ia32-msvc
  • win32-arm64-msvc
  • linux-arm64-gnu
  • linux-arm64-musl
  • linux-arm-gnueabihf
  • android-arm64

Usage

View tests/index.ts for the latest usage

Here is an example of how to use ffi-rs:

For the following C++ code, we compile this file into a dynamic library

Write Foreign Function Code

Note: The return value type of a function must be of type C

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>

extern "C" int sum(int a, int b) { return a + b; }

extern "C" double doubleSum(double a, double b) { return a + b; }

extern "C" const char *concatenateStrings(const char *str1, const char *str2) {
  std::string result = std::string(str1) + std::string(str2);
  char *cstr = new char[result.length() + 1];
  strcpy(cstr, result.c_str());
  return cstr;
}

extern "C" void noRet() { printf("%s", "hello world"); }
extern "C" bool return_opposite(bool input) { return !input; }

Compile C Code into a Dynamic Library

$ g++ -dynamiclib -o libsum.so cpp/sum.cpp # macOS
$ g++ -shared -o libsum.so cpp/sum.cpp # Linux
$ g++ -shared -o sum.dll cpp/sum.cpp # Windows

Call Dynamic Library Using ffi-rs

Then you can use ffi-rs to invoke the dynamic library file that contains functions.

Initialization

It's suggested to develop with TypeScript to get type hints

const {
    equal
} = require('assert')
const {
    load,
    DataType,
    open,
    close,
    arrayConstructor,
    define
} = require('ffi-rs')
const a = 1
const b = 100
const dynamicLib = platform === 'win32' ? './sum.dll' : "./libsum.so"
// First open dynamic library with key for close
// It only needs to be opened once.
open({
    library: 'libsum', // key
    path: dynamicLib // path
})
const r = load({
    library: "libsum", // path to the dynamic library file
    funcName: 'sum', // the name of the function to call
    retType: DataType.I32, // the return value type
    paramsType: [DataType.I32, DataType.I32], // the parameter types
    paramsValue: [a, b] // the actual parameter values
    // freeResultMemory: true, // whether or not need to free the result of return value memory automatically, default is false
})
equal(r, a + b)
// Release library memory when you're not using it.
close('libsum')

// Use define function to define a function signature
const res = define({
    sum: {
        library: "libsum",
        retType: DataType.I32,
        paramsType: [DataType.I32, DataType.I32],
    },
    atoi: {
        library: "libnative",
        retType: DataType.I32,
        paramsType: [DataType.String],
    }
})
equal(res.sum([1, 2]), 3)
equal(res.atoi(["1000"]), 1000)

Load Main Program Handle

You can also pass an empty path string in the open function like ffi-napi to get the main program handle. Refer to dlopen

open({
    library: "libnative",
    path: "",
});
// In Darwin/Linux, you can call the atoi function which is included in the basic C library
equal(
    load({
        library: "libnative",
        funcName: "atoi",
        retType: DataType.I32,
        paramsType: [DataType.String],
        paramsValue: ["1000"],
    }),
    1000,
);

Basic Types

number|string|boolean|double|void are basic types

const c = "foo"
const d = c.repeat(200)

equal(c + d, load({
    library: 'libsum',
    funcName: 'concatenateStrings',
    retType: DataType.String,
    paramsType: [DataType.String, DataType.String],
    paramsValue: [c, d]
}))

equal(undefined, load({
    library: 'libsum',
    funcName: 'noRet',
    retType: DataType.Void,
    paramsType: [],
    paramsValue: []
}))

equal(1.1 + 2.2, load({
    library: 'libsum',
    funcName: 'doubleSum',
    retType: DataType.Double,
    paramsType: [DataType.Double, DataType.Double],
    paramsValue: [1.1, 2.2]
}))
const bool_val = true
equal(!bool_val, load({
    library: 'libsum',
    funcName: 'return_opposite',
    retType: DataType.Boolean,
    paramsType: [DataType.Boolean],
    paramsValue: [bool_val],
}))

Buffer

In the latest version, ffi-rs supports modifying data in place.

The sample code is as follows

extern int modifyData(char* buffer) {
    // modify buffer data in place
}
const arr = Buffer.alloc(200) // create buffer
const res = load({
    library: "libsum",
    funcName: "modifyData",
    retType: DataType.I32,
    paramsType: [
        DataType.U8Array
    ],
    paramsValue: [arr]
})
console.log(arr) // buffer data can be updated

Array

When using array as retType , you should use arrayConstructor to specify the array type with a legal length which is important.

If the length is incorrect, the program may exit abnormally

extern "C" int *createArrayi32(const int *arr, int size) {
  int *vec = (int *)malloc((size) * sizeof(int));

  for (int i = 0; i < size; i++) {
    vec[i] = arr[i];
  }
  return vec;
}
extern "C" double *createArrayDouble(const double *arr, int size) {
  double *vec = (double *)malloc((size) * sizeof(double));
  for (int i = 0; i < size; i++) {
    vec[i] = arr[i];
  }
  return vec;
}

extern "C" char **createArrayString(char **arr, int size) {
  char **vec = (char **)malloc((size) * sizeof(char *));
  for (int i = 0; i < size; i++) {
    vec[i] = arr[i];
  }
  return vec;
}
let bigArr = new Array(100).fill(100)
deepStrictEqual(bigArr, load({
    library: 'libsum',
    funcName: 'createArrayi32',
    retType: arrayConstructor({
        type: DataType.I32Array,
        length: bigArr.length
    }),
    paramsType: [DataType.I32Array, DataType.I32],
    paramsValue: [bigArr, bigArr.length],
}))

let bigDoubleArr = new Array(5).fill(1.1)
deepStrictEqual(bigDoubleArr, load({
    library: 'libsum',
    funcName: 'createArrayDouble',
    retType: arrayConstructor({
        type: DataType.DoubleArray,
        length: bigDoubleArr.length
    }),
    paramsType: [DataType.DoubleArray, DataType.I32],
    paramsValue: [bigDoubleArr, bigDoubleArr.length],
}))
let stringArr = [c, c.repeat(20)]

deepStrictEqual(stringArr, load({
    library: 'libsum',
    funcName: 'createArrayString',
    retType: arrayConstructor({
        type: DataType.StringArray,
        length: stringArr.length
    }),
    paramsType: [DataType.StringArray, DataType.I32],
    paramsValue: [stringArr, stringArr.length],
}))

Pointer

These functions are used to handle pointer types in ffi-rs . We use DataType.External to pass pointers between Node.js and C .

Create Pointer

Use createPointer to create a pointer for specific type in the code as follows:

extern "C"
void receiveNumPointer(const int * num)

// use the rust type expression the pointer type is *const i32
const pointer: JsExternal[] = createPointer({
    paramsType: [DataType.I32],
    paramsValue: [100],
})

load({
    library: "libsum",
    funcName: "receiveNumPointer",
    paramsType: [DataType.External],
    paramsValue: pointer,
    retType: DataType.Void,
})

unwrapPointer

Use createPointer to create a data type which store in heap will receive a double pointer means a pointer to a pointer. So we need to use unwrapPointer to get the inner pointer when call foreign function.

extern "C"
void receiveStringPointer(const char * str)

// because of string is a pointer, so the pointer is a double pointer means a pointer to a string pointer
// use the rust type expression pointer type is *mut *const char
const pointer: JsExternal[] = createPointer({
    paramsType: [DataType.String],
    paramsValue: ["hello"],
})

load({
    library: "libsum",
    funcName: "receiveStringPointer",
    paramsType: [DataType.External],
    paramsValue: unwrapPointer(pointer), // use the unwrapPointer to get the inner *mut *const char pointer, which points to a *const char value
    retType: DataType.Void,
})

restorePointer

If you want to restore the pointer to the original value, you can use the restorePointer function. Corresponds to createPointer , it can receive the result of createPointer and return the original pointer directly without wrapPointer or unwrapPointer .

const pointer: JsExternal[] = createPointer({
    paramsType: [DataType.String],
    paramsValue: ["hello"],
})
const str = restorePointer({
    retType: [DataType.String],
    paramsValue: pointer,
})
equal(str, "hello")

wrapPointer

Use wrapPointer when you want to restore the foreign function return value.

extern "C" const char * returnStringPointer() {
    char * str = new char[6];
    strcpy(str, "hello");
    return str;
}
// the stringPointer type is *const char, we need to convert it to *mut *const char before call restorePointer
const stringPointer = load({
    library: "libsum",
    funcName: "returnStringPointer",
    retType: DataType.External,
    paramsType: [DataType.String],
    paramsValue: ["hello"],
})

const wrapStringPointer = wrapPointer([stringPointer])

const str = restorePointer({
    retType: [DataType.String],
    paramsValue: wrapStringPointer,
})
equal(str, "hello")

freePointer

Use freePointer to free the pointer when it is no longer in use.

const i32Ptr = createPointer({
    paramsType: [DataType.I32],
    paramsValue: [100]
})
const i32Data = restorePointer({
    paramsValue: i32Ptr
    retType: [DataType.I32],
})
freePointer({
    paramsType: [DataType.I32],
    paramsValue: i32Ptr,
    pointerType: PointerType.RsPointer
})

extern "C" const char * returnStringPointer() {
    char * str = new char[6];
    strcpy(str, "hello");
    return str;
}
const stringPointer = load({
    library: "libsum",
    funcName: "returnStringPointer",
    retType: DataType.External,
    paramsType: [DataType.String],
    paramsValue: ["hello"],
})
freePointer({
    paramsType: [DataType.External],
    paramsValue: [stringPointer],
    pointerType: PointerType.CPointer // will use libc::free to free the memory
})

Struct

To create a C struct or get a C struct as a return type, you need to define the types of the parameters strictly in the order in which the fields of the C structure are defined.

ffi-rs provides a C struct named Person with many types of fields in sum.cpp

The example call method about how to call a foreign function to create a Person struct or use Person struct as a return value is here

Use array in struct

There are two types of arrays in C language like int* array and int array[100] that have some different usages.

The first type int* array is a pointer type storing the first address of the array.

The second type int array[100] is a fixed-length array and each element in the array has a continuous address.

If you use an array as a function parameter, this usually passes an array pointer regardless of which type you define. But if the array type is defined in a struct, the two types of array definitions will cause different sizes and alignments of the struct.

So, ffi-rs needs to distinguish between the two types.

By default, ffi-rs uses dynamic arrays to calculate struct. If you confirm there is a static array, you can define it in this way:

typedef struct Person {
  //...
  uint8_t staticBytes[16];
  //...
} Person;

// use arrayConstructor and set ffiTypeTag field to DataType.StackArray
staticBytes: arrayConstructor({
  type: DataType.U8Array,
  length: parent.staticBytes.length,
  ffiTypeTag: FFITypeTag.StackArray
}),

Function

ffi-rs supports passing JS function pointers to C functions, like this:

typedef const void (*FunctionPointer)(int a, bool b, char *c, double d,
                                      char **e, int *f, Person *g);

extern "C" void callFunction(FunctionPointer func) {
  printf("callFunction\n");

  for (int i = 0; i < 2; i++) {
    int a = 100;
    bool b = false;
    double d = 100.11;
    char *c = (char *)malloc(14 * sizeof(char));
    strcpy(c, "Hello, World!");

    char **stringArray = (char **)malloc(sizeof(char *) * 2);
    stringArray[0] = strdup("Hello");
    stringArray[1] = strdup("world");

    int *i32Array = (int *)malloc(sizeof(int) * 3);
    i32Array[0] = 101;
    i32Array[1] = 202;
    i32Array[2] = 303;

    Person *p = createPerson();
    func(a, b, c, d, stringArray, i32Array, p);
  }
}

Corresponding to the code above, you can use ffi-rs like this:

const testFunction = () => {
    const func = (a, b, c, d, e, f, g) => {
        equal(a, 100);
        equal(b, false);
        equal(c, "Hello, World!");
        equal(d, "100.11");
        deepStrictEqual(e, ["Hello", "world"]);
        deepStrictEqual(f, [101, 202, 303]);
        deepStrictEqual(g, person);
        logGreen("test function succeed");
        // free function memory when it is not in use
        freePointer({
            paramsType: [funcConstructor({
                paramsType: [
                    DataType.I32,
                    DataType.Boolean,
                    DataType.String,
                    DataType.Double,
                    arrayConstructor({
                        type: DataType.StringArray,
                        length: 2
                    }),
                    arrayConstructor({
                        type: DataType.I32Array,
                        length: 3
                    }),
                    personType,
                ],
                retType: DataType.Void,
            })],
            paramsValue: funcExternal
        })
        if (!process.env.MEMORY) {
            close("libsum");
        }
    };
    // suggest using createPointer to create a function pointer for manual memory management
    const funcExternal = createPointer({
        paramsType: [funcConstructor({
            paramsType: [
                DataType.I32,
                DataType.Boolean,
                DataType.String,
                DataType.Double,
                arrayConstructor({
                    type: DataType.StringArray,
                    length: 2
                }),
                arrayConstructor({
                    type: DataType.I32Array,
                    length: 3
                }),
                personType,
            ],
            retType: DataType.Void,
        })],
        paramsValue: [func]
    })
    load({
        library: "libsum",
        funcName: "callFunction",
        retType: DataType.Void,
        paramsType: [
            DataType.External,
        ],
        paramsValue: unwrapPointer(funcExternal),
    });
}

The function parameters support all types in the example above.

Attention: since the vast majority of scenarios developers pass JS functions to C as callbacks, ffi-rs will create threadsafe_function from JS functions which means the JS function will be called asynchronously, and the Node.js process will not exit automatically.

C++

We'll provide more examples from real-world scenarios. If you have any ideas, please submit an issue.

Class type

In C++ scenarios, we can use DataType.External to get a class type pointer.

In the code below, we use C types to wrap C++ types such as converting char * to std::string and returning a class pointer:

MyClass *createMyClass(std::string name, int age) {
  return new MyClass(name, age);
}

extern "C" MyClass *createMyClassFromC(const char *name, int age) {
  return createMyClass(std::string(name), age);
}

extern "C" void printMyClass(MyClass *instance) { instance->print(); }

And then, it can be called by the following code:

const classPointer = load({
    library: "libsum",
    funcName: "createMyClassFromC",
    retType: DataType.External,
    paramsType: [
        DataType.String,
        DataType.I32
    ],
    paramsValue: ["classString", 26],
});
load({
    library: "libsum",
    funcName: "printMyClass",
    retType: DataType.External,
    paramsType: [
        DataType.External,
    ],
    paramsValue: [classPointer],
})
freePointer({
    paramsType: [DataType.External],
    paramsValue: [classPointer],
    pointerType: PointerType.CPointer
})

errno

By default, ffi-rs will not output errno info. Developers can get it by passing errno: true when calling the open method like:

load({
    library: 'libnative',
    funcName: 'setsockopt',
    retType: DataType.I32,
    paramsType: [DataType.I32, DataType.I32, DataType.I32, DataType.External, DataType.I32],
    paramsValue: [socket._handle.fd, level, option, pointer[0], 4],
    errno: true // set errno as true
})

// The above code will return an object including three fields: errnoCode, errnoMessage, and the foreign function return value
// { errnoCode: 22, errnoMessage: 'Invalid argument (os error 22)', value: -1 }

Memory Management

It's important to free the memory allocations during a single ffi call to prevent memory leaks.

What kinds of data memory are allocated in this?

  • Call parameters in the Rust environment which are allocated in the heap like String
  • Return value which in the C environment which are allocated in the heap like char*

By default, ffi-rs will free call parameters memory which are allocated in Rust.

But it will not free the return value from the C side since some C dynamic libraries will manage their memory automatically (when ffi-rs >= 1.0.79)

There are two ways to prevent ffi-rs from releasing memory:

  • Set freeResultMemory: false when calling load method, the default value is false

If you set freeResultMemory to false, ffi-rs will not release the return result memory which was allocated in the C environment

  • Use DataType.External as paramsType or retType

If developers use DataType.External as paramsType or retType, please use freePointer to release the memory of the pointer when this memory is no longer in use. ref test.ts

runInNewThread

ffi-rs supports running ffi tasks in a new thread without blocking the main thread, which is useful for CPU-intensive tasks.

To use this feature, you can pass the runInNewThread option to the load method:

const testRunInNewThread = async () => {
    // will return a promise but the task will run in a new thread
    load({
        library: "libsum",
        funcName: "sum",
        retType: DataType.I32,
        paramsType: [DataType.I32, DataType.I32],
        paramsValue: [1, 2],
        runInNewThread: true,
    }).then(res => {
        equal(res, 3)
    })
}

changelog

1.2.14 (2025-07-11)

Bug Fixes

  • add default value for paramsValue when call define method close #77 (946b889)
  • add freePointer, free memory after ffi-call prevent memory leak (#40) (f639628)
  • add libnative only in linux/darwin (89ac7e4)
  • avoid xlocale/_stdio.h outside (macOS only) (4caaaa6)
  • calculate struct pointer offset padding (9ee7c10)
  • call_with_return_value error tips (43b0125)
  • ci (69214d0)
  • ci add darwin-x64 target (55906a7)
  • convert JsString to UTF-16 string (70ea15c)
  • convert jsString to UTF-16 string, create cstring from bytes manually (5fad2d0)
  • convert JsString to UTF-8 string (c613f66)
  • createPointer for struct (cf6c237)
  • dependencies (ef4de0d)
  • disappear runInNewThread when return type is void (2e799e9)
  • judge func_ret_type is void condition (6b96974)
  • No need to free jsBuffer memory in rust call params (2e39791)
  • object pointer offset position (df1d0c3)
  • pre alloc current size for create struct_array (72b169a)
  • publish main package (66ef423)
  • restore call params in main thread (2b3c6c9)
  • restore pointer params in function call params (39803a8)
  • return bigInt when use struct field (0be42a7)
  • return buffer (026141c)
  • stack struct (d90b4fc)
  • struct offset position (74d7587)
  • update createPointer logic (9b61dc6)
  • use cstr create string for protect ownership (562bfc6)
  • use cstr return string (33e0d4c)
  • use ctx.env to restore function params in another thread (a204e4b)
  • use explicit path to load libsum.so (21e2b23)
  • use koffi correctly for accurate benchmark (e0ecfc5)
  • win32 (19fa8bc)

Features

  • add FFITypeTag::StackStruct (72931b0)
  • add aarch64-pc-windows-msvc artifact (23b3118)
  • add arrayConstructor judge (bebcc94)
  • add basictype and reftype (79aa944)
  • add benchmark (e6a0b5e)
  • add benchmark (5c9b1cc)
  • add call c++ class example (be1d8ac)
  • add changelog (403333c)
  • add DataType.void (1d0ff24)
  • add define methods to define function signature (5945682)
  • add ffi-rs (79e9594)
  • add ffi-rs (39596d5)
  • add freeCFuncParamsMemory in funcConstructor (c5f298e)
  • add FunctionNotFound err type (fb430b9)
  • add get_data_type_size_align (10487ed)
  • add get_js_unknown_from_pointer (8a08f39)
  • add github Dependabot (#16) (eb41e0d)
  • add issue template (e4aef11)
  • add license close #66 (137c306)
  • add linux-arm-gnueabihf (8cf9cfe)
  • add linux-arm-gnueabihf (ef61ea4)
  • add linux-arm-gnueabihf (9ae05b5)
  • add new export enum FFITypeTag for specific type (5d6c73f)
  • add ResultWithErrno type support (c21c375)
  • add scope (c368e43)
  • add tips for jsobject/array when used in new thread (41da725)
  • add ToJsArray trait (2e1cebc)
  • add ToRsArray trait (c7423ce)
  • add TsFnCallContext (84df186)
  • cache function symbol in global variables (b08f157)
  • call tsfn in c other thread (7c8b0dc)
  • check whether params_type length and params_value length is equal (dd9260c)
  • demo add createPerson (9456d6a)
  • dynamicArray support more array type (170e9fb)
  • eradicate panic (d1b29c2)
  • function parameter support object (64bf19e)
  • implement create clousre by libffi::middle support more types (#25) (608237f)
  • implement runInNewThread (#31) (f908400)
  • improve threadsafefunction (9ea02e0)
  • init (73856dd)
  • judge library path exist or not before call open (a97c26f)
  • mock jsExternal type (479daab)
  • modifying all string handling functions to uniform UTF-16 handling (19573b4)
  • optimize ffi_call return value (80b6985)
  • performance optimization by reduce cloning (45c4986)
  • refactor get_js_external_wrap_data (9f6878c)
  • refactor type hint (dcda3a8)
  • rename createExternal to createPointer (2524c7d)
  • rename unpackPointer to unwrapPointer (8259780)
  • set correct size in create_external (80d8374)
  • set freeResultMemory as false at default (ddcf108)
  • static link msvc in windows (ffd2e4f)
  • support android-arm64 (78b7fcb)
  • support boolean type (f4f7ee9)
  • support byteArray aka u8Array (341b37c)
  • support char type aka u8 (5c98b30)
  • support create staic float array from pointer (5f89094)
  • support createExternal (8b7a2cb)
  • support DataType.BigInt (cf05fab)
  • support DataType.float (0f2ec4e)
  • support DataType.I16 (3b1cb28)
  • support DataType.I16Array (1fdc724)
  • support double type (c975817)
  • support doubleArray (9cdb45e)
  • support floatArray as paramsType (a7fef73)
  • support function as params skip ci (b75df3d)
  • support generate nested object (bfd0ba3)
  • support i32array (8078d1b)
  • support install x86 artifact on x64 (2b12695)
  • support isNullPointer (e3ec0c0)
  • support linux-x64-musl (02a1b43)
  • support Load Main Program handle (8e821b8)
  • support long type aka i64 (6147657)
  • support object type (79e90a8)
  • support open and close dynamic library (d933720)
  • support output errno info (ae265fb)
  • support pass js function to ffi-rs (20741ec)
  • support pass jsFunction return value to c (#60) (44c19be)
  • support pass stackStruct in function call (0156b32)
  • support pointer type aka jsexternal (e091fff)
  • support replace in place (921fbab)
  • support restore stack struct (2cd1def)
  • support restoreExternal (b2dd20d)
  • support stack struct (#41) (28cb2d4)
  • support static array in c struct field (890a310)
  • support string array (2388993)
  • support struct array (e60faf7)
  • support struct double type field (27e40ee)
  • support struct field type doubleArray (75af21e)
  • support struct field type i32Array (a2c1274)
  • support struct with field type stringArr doubleArr (1c450fb)
  • support u64 fix i64 (9d10531)
  • support wideString (a9828b2)
  • support win32 (7aa7630)
  • support wrapPointer and unpackPointer (4406477)
  • support x86_64-unknown-linux-musl (1db4e0b)
  • suppprt freePointer (dbd50bb)
  • thread function (#12) (a17910a)
  • thread safe function in multiple thread (94d4af5)
  • update calculate (68776da)
  • update create struct for struct array (ae9f8d8)
  • update d.ts (7aeeb20)
  • update d.ts tips (85c9b03)
  • update error tips when open uncompatible share library (a947241)
  • update FFICALLPARAMS implemention (a09c44d)
  • update get_arg_types_values (ee3f3a0)
  • update get_symbol about use Result as return type (a24ebba)
  • update get_value_pointer method by ? operator (088e02f)
  • update napi version (d2a6952)
  • update OpeningLibraryError tips (0aa86b4)
  • update optionalDependencies (30dcfd0)
  • update publish script support alpha (45ca8e3)
  • update rs_array_to_js_array method by ? operator (ef4ba5f)
  • update string judge compatible with bun (6103692)
  • update type_define_to_rs_args method by ? operator (fe77239)
  • update types (bd12e4c)
  • update types about change const enum to enum close #89 (98703af)
  • update types close #95 (f364454)
  • update zh readme.md (13c7635)
  • use ? operator replace unwrap in get_params_value_rs_struct method (25390e8)
  • use ? replace unwrap refactor get_arg_types_values method (2314106)
  • use call_with_return_value when retType is not void-n (2448c5d)
  • use closure replace closureonce for multicall (85f255c)
  • use cstring replace cstr restore c string from pointer (704d878)
  • use dataType replace paramsType (bb59141)
  • use DataType replace specific number (6e32850)
  • use FFITypeTag::StackArray replace dynamicArray parameter (b7c5874)
  • use jsnumber as return type (4108536)
  • use ref as params type avoid clone (b9d37fb)
  • use result style as return type (9374f78)
  • use safe u8Array when call threadsafefunction (efb4c06)
  • use trait to implement feature insteadof separate function (f2679b9)
  • use unchecked napi transform improve performance (8100d8a)
  • visit jsValue in main thread prevent thread error (9eb78b1)