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

Implement missing node:fs APIs #18218

Closed
56 of 60 tasks
AliBasicCoder opened this issue Sep 25, 2020 · 19 comments
Closed
56 of 60 tasks

Implement missing node:fs APIs #18218

AliBasicCoder opened this issue Sep 25, 2020 · 19 comments
Assignees
Labels
node API polyfill Related to various "node:*" modules APIs node compat

Comments

@AliBasicCoder
Copy link
Contributor

AliBasicCoder commented Sep 25, 2020

Current status: 52/58

  • fs.lchown
  • fs.lchownSync
  • fs.lchmod
  • fs.lchmodSync
  • fs.fchown
  • fs.fchownSync
  • fs.lutimes
  • fs.lutimesSync
  • fs.readv
  • fs.readvSync
  • fs.createReadStream
  • fs.createWriteStream
  • fs.fdatasync
  • fs.fdatasyncSync
  • fs.fstat
  • fs.fstatSync
  • fs.fsync
  • fs.fsyncSync
  • fs.ftruncate
  • fs.ftruncateSync
  • fs.futimes
  • fs.futimesSync
  • fs.link
  • fs.linkSync
  • fs.lstat
  • fs.lstatSync
  • fs.mkdtemp
  • fs.mkdtempSync
  • fs.open
  • fs.opendir
  • fs.opendirSync
  • fs.read (with it's to overwrites)
  • fs.readdir
  • fs.readdirSync
  • fs.readSync (with it's to overwrites)
  • fs.realpath
  • fs.realpath.native
  • fs.realpathSync
  • fs.realpathSync.native
  • fs.rename
  • fs.renameSync
  • fs.rmdir
  • fs.rmdirSync
  • fs.stat
  • fs.statSync
  • fs.symlink
  • fs.symlinkSync
  • fs.truncate
  • fs.truncateSync
  • fs.unlink
  • fs.unlinkSync
  • fs.unwatchFile
  • fs.utimes
  • fs.utimesSync
  • fs.watch
  • fs.watchFile
  • fs.write (with it's to overwrites)
  • fs.writeSync (with it's to overwrites)
  • fs.writev
  • fs.writevSync
@AliBasicCoder
Copy link
Contributor Author

i noticed that Deno.symlink doesn't exist ??

@ry
Copy link
Member

ry commented Sep 25, 2020

symlink is unstable https://doc.deno.land/builtin/unstable#Deno.symlink

@AliBasicCoder
Copy link
Contributor Author

see #7666

@Liamolucko
Copy link
Contributor

Liamolucko commented Nov 27, 2020

Some of these have now been implemented, here's an updated checklist:

(Update(@kt3k): Removed the list of APIs with checkboxes here. We keep updating the list above)

@lp
Copy link
Contributor

lp commented Dec 2, 2020

I would grab some, for a start I would go with mkdtemp/mkdtempSync. Anybody already on the case?

@majidsajadi
Copy link
Contributor

majidsajadi commented Apr 1, 2021

@kt3k I see you updated this comment. i guess link and linkSync are implemented too.

I will send some PR`s for:

  • fs.fdatasync
  • fs.fdatasyncSync
  • fs.fstat
  • fs.fstatSync
  • fs.fsync
  • fs.fsyncSync
  • fs.ftruncate
  • fs.ftruncateSync
  • fs.futimes
  • fs.futimesSync

@F3n67u
Copy link
Contributor

F3n67u commented Aug 27, 2021

may i work on this issue?

@bartlomieju
Copy link
Member

@F3n67u yes, please do

@AliBasicCoder
Copy link
Contributor Author

may i work on this issue?

please reference this issue in any PRs you're gonna create

@F3n67u
Copy link
Contributor

F3n67u commented Aug 28, 2021

may i work on this issue?

please reference this issue in any PRs you're gonna create

@AliBasicCoder ok, I will

@F3n67u
Copy link
Contributor

F3n67u commented Aug 29, 2021

@AliBasicCoder I tried to implement fs.opendir and fs.opendirSync, but looks like these methods are missing from deno fs api. @majidsajadi also mention this problem at denoland/std#802. I need to open issue at deno repo about the api Deno.opendir missing before I can implement the node counterpart, right?

@kt3k
Copy link
Member

kt3k commented Dec 8, 2021

I'll work on fs.access https://nodejs.org/api/fs.html#fsaccesspath-mode-callback

@talentlessguy
Copy link

Implementing createReadStream would be awesome 🙏

(I'm rewriting a port of a Node.js framework and I need this func for readFile func)

@iuioiua
Copy link
Contributor

iuioiua commented Sep 8, 2022

I believe the following are required from the Deno FS API to be implemented:

  • fs.lchmod
  • fs.lchmodSync
  • fs.lutimes
  • fs.lutimesSync
  • fs.readv
  • fs.readvSync

Is this correct?

@kt3k
Copy link
Member

kt3k commented Sep 8, 2022

I guess the last 2 could be polyfilled if we don't mind the performance

@lino-levan
Copy link
Contributor

@kt3k should this still be in denoland/deno_std?

@kt3k kt3k transferred this issue from denoland/std Mar 16, 2023
@kt3k kt3k changed the title std/node/fs missing a lot of functionality Implement missing node:fs APIs Mar 16, 2023
@bartlomieju bartlomieju added the node API polyfill Related to various "node:*" modules APIs label Mar 4, 2024
nathanwhit added a commit that referenced this issue Apr 2, 2024
Part of #18218.

Implements `fs.readv` and `fs.readvSync` and enables the corresponding
`node_compat` tests.
satyarohith pushed a commit that referenced this issue Apr 11, 2024
Part of #18218.

Implements `fs.readv` and `fs.readvSync` and enables the corresponding
`node_compat` tests.
@bartlomieju
Copy link
Member

Ref #21260

@iuioiua
Copy link
Contributor

iuioiua commented Jun 19, 2024

Another possible reason to add Deno.lutimes(): denoland/std#5083

nathanwhit added a commit that referenced this issue Jul 3, 2024
Part of #18218


- Adds `fs.lutimes` and `fs.lutimesSync` to our node polyfills. To do
this I added methods to the `FileSystem` trait + ops to expose the
functionality to JS.
- Exports `fs._toUnixTimestamp`. Node exposes an internal util
`toUnixTimestamp` from the fs module to be used by unit tests (so we
need it for the unit test to pass unmodified). It's weird because it's
only supposed to be used internally but it's still publicly accessible
- Matches up error handling and timestamp handling for fs.futimes and
fs.utimes with node
- Enables the node_compat utimes test - this exercises futimes, lutimes,
and utimes.
nathanwhit added a commit that referenced this issue Jul 5, 2024
Closes #21260.
Part of #18218.

Implements `node:fs.lchown`, and enables the node_compat test for it.
The test uses `process.getegid`, which we didn't have implemented, so I
went ahead and implemented that as well to get the test working.
zebreus pushed a commit to zebreus/deno that referenced this issue Jul 8, 2024
Part of denoland#18218


- Adds `fs.lutimes` and `fs.lutimesSync` to our node polyfills. To do
this I added methods to the `FileSystem` trait + ops to expose the
functionality to JS.
- Exports `fs._toUnixTimestamp`. Node exposes an internal util
`toUnixTimestamp` from the fs module to be used by unit tests (so we
need it for the unit test to pass unmodified). It's weird because it's
only supposed to be used internally but it's still publicly accessible
- Matches up error handling and timestamp handling for fs.futimes and
fs.utimes with node
- Enables the node_compat utimes test - this exercises futimes, lutimes,
and utimes.
zebreus pushed a commit to zebreus/deno that referenced this issue Jul 8, 2024
)

Closes denoland#21260.
Part of denoland#18218.

Implements `node:fs.lchown`, and enables the node_compat test for it.
The test uses `process.getegid`, which we didn't have implemented, so I
went ahead and implemented that as well to get the test working.
@lucacasonato
Copy link
Member

Just one left, closing in favor of #26020.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node API polyfill Related to various "node:*" modules APIs node compat
Projects
None yet
Development

No branches or pull requests