Conversation
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement
Implement missing opendir API methods
Jul 25, 2025
opendir API
streamich
requested changes
Jul 25, 2025
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
streamich
requested changes
Jul 25, 2025
Owner
streamich
left a comment
There was a problem hiding this comment.
Prettier check yarn prettier:check is failing, run yarn prettier to reformat codebase.
Commitlint CI check is failing, submit your PR using Angular-style commit mesasges, like feat: implemented such an such.
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Contributor
Author
Fixed prettier formatting issues and updated to use Angular-style commit messages as requested. The |
Contributor
|
🎉 This PR is included in version 4.18.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the missing
opendirAPI methods that were requested in issue #663. All variants of the Node.jsopendirmethod are now available on thefsexport:fs.opendir(path[, options], callback)fs.opendirSync(path[, options])fs.promises.opendir(path[, options])(was already working)Root Cause
The
opendirfunctionality was already fully implemented in theVolumeclass, including:opendirBase()- Core implementationopendir()- Callback versionopendirSync()- Synchronous versionDirclass - Complete fs.Dir implementationFsPromisesclassHowever, the callback and synchronous methods were not exposed in the
fsexport because they were missing from the API binding lists.Changes Made
Fixed the API exposure by adding the missing methods to the binding lists:
'opendir'tofsCallbackApiList.ts'opendirSync'tofsSynchronousApiList.tsAdded comprehensive tests in
src/__tests__/volume/opendir.test.tsto verify:encoding,bufferSize,recursive)API Compliance
All implementations fully comply with the Node.js fs API specification:
The returned
fs.Dirobjects provide all required methods:read(),readSync(),close(),closeSync(), and async iteration support.Testing
Fixes #663.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.