From 2d1dcb87e682fbe66bce7b44d73ef08227c0fc8e Mon Sep 17 00:00:00 2001 From: Haram Jeong <91401364+haramj@users.noreply.github.com> Date: Wed, 16 Jul 2025 15:44:22 +0900 Subject: [PATCH] doc: clarify ERR_FS_FILE_TOO_LARGE to reflect fs.readFile() I/O limit PR-URL: https://github.com/nodejs/node/pull/59050 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: LiviaMedeiros --- doc/api/errors.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index df530ec74bf..e928dc15572 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1362,8 +1362,10 @@ Path is a directory. ### `ERR_FS_FILE_TOO_LARGE` -An attempt has been made to read a file whose size is larger than the maximum -allowed size for a `Buffer`. +An attempt was made to read a file larger than the supported 2 GiB limit for +`fs.readFile()`. This is not a limitation of `Buffer`, but an internal I/O constraint. +For handling larger files, consider using `fs.createReadStream()` to read the +file in chunks.