@@ -76,6 +76,29 @@ Supported type names:
7676* ` arraybuffer `
7777* ` function `
7878
79+ These type names are also exposed as constants on ` ffi.types ` :
80+
81+ * ` ffi.types.VOID ` = ` 'void' `
82+ * ` ffi.types.POINTER ` = ` 'pointer' `
83+ * ` ffi.types.BUFFER ` = ` 'buffer' `
84+ * ` ffi.types.ARRAY_BUFFER ` = ` 'arraybuffer' `
85+ * ` ffi.types.FUNCTION ` = ` 'function' `
86+ * ` ffi.types.BOOL ` = ` 'bool' `
87+ * ` ffi.types.CHAR ` = ` 'char' `
88+ * ` ffi.types.STRING ` = ` 'string' `
89+ * ` ffi.types.FLOAT ` = ` 'float' `
90+ * ` ffi.types.DOUBLE ` = ` 'double' `
91+ * ` ffi.types.INT_8 ` = ` 'int8' `
92+ * ` ffi.types.UINT_8 ` = ` 'uint8' `
93+ * ` ffi.types.INT_16 ` = ` 'int16' `
94+ * ` ffi.types.UINT_16 ` = ` 'uint16' `
95+ * ` ffi.types.INT_32 ` = ` 'int32' `
96+ * ` ffi.types.UINT_32 ` = ` 'uint32' `
97+ * ` ffi.types.INT_64 ` = ` 'int64' `
98+ * ` ffi.types.UINT_64 ` = ` 'uint64' `
99+ * ` ffi.types.FLOAT_32 ` = ` 'float32' `
100+ * ` ffi.types.FLOAT_64 ` = ` 'float64' `
101+
79102Pointer-like types (` pointer ` , ` string ` , ` buffer ` , ` arraybuffer ` , and
80103` function ` ) are all passed through the native layer as pointers.
81104
@@ -114,6 +137,28 @@ const signature = {
114137};
115138```
116139
140+ ## ` ffi.suffix `
141+
142+ <!-- YAML
143+ added: REPLACEME
144+ -->
145+
146+ * {string}
147+
148+ The native shared library suffix for the current platform:
149+
150+ * ` 'dylib' ` on macOS
151+ * ` 'so' ` on Unix-like platforms
152+ * ` 'dll' ` on Windows
153+
154+ This can be used to build portable library paths:
155+
156+ ``` cjs
157+ const { suffix } = require (' node:ffi' );
158+
159+ const path = ` libsqlite3.${ suffix} ` ;
160+ ```
161+
117162## ` ffi.dlopen(path[, definitions]) `
118163
119164<!-- YAML
0 commit comments