Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v18.x backport] fs: add a fast-path for readFileSync utf-8 #49693

Open
wants to merge 6 commits into
base: v18.x-staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! fs: add a fast-path for readFileSync utf-8
Backport-PR-URL: #48658
  • Loading branch information
anonrig authored and H4ad committed Dec 2, 2023
commit fdcc2da60c378835a75995ca0332d2030b044979
4 changes: 2 additions & 2 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const {
validateInteger,
validateObject,
} = require('internal/validators');
const { readFileSyncUtf8 } = require('internal/fs/read-file/utf8');
const { readFileSyncUtf8 } = require('internal/fs/read/utf8');

let truncateWarn = true;
let fs;
Expand Down Expand Up @@ -384,7 +384,7 @@ function checkAborted(signal, callback) {
function readFile(path, options, callback) {
callback = maybeCallback(callback || options);
options = getOptions(options, { flag: 'r' });
const ReadFileContext = require('internal/fs/read-file/context');
const ReadFileContext = require('internal/fs/read/context');
const context = new ReadFileContext(callback, options.encoding);
context.isUserFd = isFd(path); // File descriptor ownership

Expand Down
File renamed without changes.
File renamed without changes.