diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 05d8113ace68..7d4a70a37877 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -536,6 +536,8 @@ added: - v20.16.0 --> +* Returns: {Promise} + The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise`. ```js @@ -566,6 +568,7 @@ added: * `start` {number} The starting index. * `end` {number} The ending index. * `type` {string} The content-type for the new `Blob` +* Returns: {Blob} Creates and returns a new `Blob` containing a subset of this `Blob` objects data. The original `Blob` is not altered. @@ -5278,6 +5281,7 @@ added: > Stability: 3 - Legacy. Use `Buffer.from(data, 'base64')` instead. * `data` {any} The Base64-encoded input string. +* Returns: {string} Decodes a string of Base64-encoded data into bytes, and encodes those bytes into a string using Latin-1 (ISO-8859-1). @@ -5308,6 +5312,7 @@ added: > Stability: 3 - Legacy. Use `buf.toString('base64')` instead. * `data` {any} An ASCII (Latin1) string. +* Returns: {string} Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes into a string using Base64. diff --git a/doc/api/ffi.md b/doc/api/ffi.md index 158aadffa3e3..54de34da7a18 100644 --- a/doc/api/ffi.md +++ b/doc/api/ffi.md @@ -126,13 +126,26 @@ raw pointer `bigint` values. For pointer-like parameters, `null`, `undefined`, strings, `Buffer`, typed array, `DataView`, and `ArrayBuffer` values are converted on the JavaScript side before calling the optimized native wrapper. -Optimized Fast FFI calls support at most 8 function arguments, but the exact -limit depends on the architecture and on the argument types, because each -argument must fit in the registers used by the platform trampoline. Integer -and pointer arguments are limited to 7 on AArch64 and to 6 on x86-64, while -floating-point arguments can use up to 8 on both. Functions that exceed these -limits, including any function with more than 8 arguments, use the generic FFI -call path instead. +Optimized Fast FFI calls fall back to the generic FFI call path when a +function's arguments or return type do not fit the platform-specific fast +trampoline. Fast FFI calls support at most 8 total arguments, and the +register and argument limits differ per architecture: + +| Architecture | Max integer/pointer args | Max floating-point args | Buffer-shaped args | Buffer-shaped + FP together | Narrow (8/16-bit) return | +| -------------------------- | ----------------------------------------- | ----------------------- | ------------------ | --------------------------- | ------------------------ | +| AArch64 | 7 (6 when a buffer-shaped arg is present) | 8 | Supported | Not supported | Supported | +| x86-64, Linux/macOS (SysV) | 6 (4 when a buffer-shaped arg is present) | 8 | Supported | Not supported | Supported | +| x86-64, Windows (Win64) | 3 (total arguments also capped at 3) | 3 | Not supported | N/A | Supported | +| s390x | 4 | 4 | Not supported | N/A | Not supported | +| PPC64LE | 7 | 8 | Not supported | N/A | Not supported | +| LoongArch64 | 7 | 8 | Not supported | N/A | Not supported | +| RISC-V (64-bit) | 7 | 8 | Not supported | N/A | Not supported | + +PPC64BE has no fast-call trampoline and always uses the generic call path. +"Buffer-shaped args" means `Buffer`, typed array, `DataView`, or `ArrayBuffer` +values passed as pointer-like arguments. Functions whose argument or return +types exceed the limits for the current platform use the generic FFI call +path instead. ## Signature objects diff --git a/doc/api/fs.md b/doc/api/fs.md index f95b1d85abec..a880c54dc69e 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1191,6 +1191,8 @@ changes: description: No longer experimental. --> +* Returns: {Promise} + Calls `filehandle.close()` and returns a promise that fulfills when the filehandle is closed. @@ -1332,6 +1334,10 @@ changes: Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. +Symbolic links are followed. If `src` is a symbolic link, the target file is +copied. If `dest` is a symbolic link, the target file is overwritten unless +`mode` contains `fs.constants.COPYFILE_EXCL`. + No guarantees are made about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, an attempt will be made to remove the destination. @@ -2850,6 +2856,10 @@ callback function. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination. +Symbolic links are followed. If `src` is a symbolic link, the target file is +copied. If `dest` is a symbolic link, the target file is overwritten unless +`mode` contains `fs.constants.COPYFILE_EXCL`. + `mode` is an optional integer that specifies the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. @@ -6019,6 +6029,10 @@ already exists. Returns `undefined`. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination. +Symbolic links are followed. If `src` is a symbolic link, the target file is +copied. If `dest` is a symbolic link, the target file is overwritten unless +`mode` contains `fs.constants.COPYFILE_EXCL`. + `mode` is an optional integer that specifies the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. @@ -7351,6 +7365,8 @@ changes: description: No longer experimental. --> +* Returns: {Promise} + Calls `dir.close()` if the directory handle is open, and returns a promise that fulfills when disposal is complete. @@ -8416,6 +8432,7 @@ of bytes written is passed as the first argument to the event handler. * `writeBufferLen` {number} * `remainingBufferLen`: {number} * `sync`: {boolean} Perform writes synchronously. +* Returns: {fs.Utf8Stream} #### `utf8Stream.append` diff --git a/doc/api/tty.md b/doc/api/tty.md index 03f86cd66052..cbfb3cc78377 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -86,6 +86,11 @@ characters. Ctrl+C will no longer cause a `SIGINT` when in this mode. This mode does not affect terminal output processing, such as newline translation on Unix terminals. +On Windows, `setRawMode()` requires write permission to the console input +buffer. When opening `"\\\\.\\CONIN$"` with the [`fs.open()`][] family of APIs +(for passing into `new tty.ReadStream()`), be sure to use a read/write flag +such as `'r+'`. + ## Class: `tty.WriteStream`