From 11d12e854f4130fb5f0ffad5c1b34aff37be48de Mon Sep 17 00:00:00 2001 From: agape1225 <49804691+agape1225@users.noreply.github.com> Date: Sat, 1 Aug 2026 22:58:50 +0900 Subject: [PATCH] doc: use ffi.suffix in permission example The `--allow-ffi` example in cli.md hard-coded the Linux-only `.so` extension. node:ffi already exposes `suffix` for exactly this case, and doc/api/ffi.md's own examples use it. Do the same here. Assisted-by: Claude Sonnet 5 Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com> --- doc/api/cli.md | 4 ++-- doc/node.1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 9434e19d3b73..ff89cc10524f 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -208,8 +208,8 @@ starting Node.js. The [`node:ffi`][] module also requires the Example: ```js -const { DynamicLibrary } = require('node:ffi'); -const lib = new DynamicLibrary('mylib.so'); +const { DynamicLibrary, suffix } = require('node:ffi'); +const lib = new DynamicLibrary(`./mylib.${suffix}`); ``` ```console diff --git a/doc/node.1 b/doc/node.1 index 05b80da80a43..b14828ba9709 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -126,8 +126,8 @@ starting Node.js. The \fBnode:ffi\fR module also requires the \fB--experimental-ffi\fR flag and is only available in builds with FFI support. Example: .Bd -literal -const { DynamicLibrary } = require('node:ffi'); -const lib = new DynamicLibrary('mylib.so'); +const { DynamicLibrary, suffix } = require('node:ffi'); +const lib = new DynamicLibrary(`./mylib.${suffix}`); .Ed .Bd -literal $ node --permission --experimental-ffi index.js