Skip to content

feat: partial relative paths support#1224

Open
Mopsgamer wants to merge 13 commits intostreamich:masterfrom
Mopsgamer:fix-relative
Open

feat: partial relative paths support#1224
Mopsgamer wants to merge 13 commits intostreamich:masterfrom
Mopsgamer:fix-relative

Conversation

@Mopsgamer
Copy link
Copy Markdown

@Mopsgamer Mopsgamer commented Dec 18, 2025

Warning

There was also a useless line nearby. It might be worth submitting it independently of this PR.

Refs #23

Partial support and not fully tested. Can this be merged as is, or should contributors finalize it?

Features

  • New cwd property (getter + setter) is available for Volume and Superblock instances.

@Mopsgamer Mopsgamer changed the title fix: relative fs.promises.readFile feat: partial relative paths support Feb 1, 2026
@Mopsgamer
Copy link
Copy Markdown
Author

Sorry, I missed the merge conflicts. It was quite difficult to sort through the new changes. I noticed there are two options involving cwd, but it seems this PR needs another one.

The current interface looks like this:
memfs(json, cwd1, { process: {cwd2()}})

Right now, cwd2 acts as the mount point. From what I understand, cwd1 serves as the mount for cwd2, which seems a bit counterintuitive.

We should either add a new cwd3 option or redefine how cwd1 behaves.

cwd3 would set the current directory for resolving relative file paths within the methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant