Repository: denoland/deno
Pull request: fix(ext/node): remove extra properties from node:fs exports

## Summary
- Remove 18 flag constants (`F_OK`, `R_OK`, `W_OK`, `X_OK`, `O_RDONLY`,
  `O_WRONLY`, etc.) from `node:fs` default and named exports — Node.js only
  exposes these via `fs.constants`, not as top-level properties
- Remove internal promise helpers (`watchPromise`, `readFilePromise`,
  `readlinkPromise`) from the default export object
- Remove `statPromise`, `realpathPromise`, `statfsPromise` from named exports
  (already defined locally in `promises.ts`)

After this change, `Object.keys(require("node:fs"))` in Deno matches Node.js
except for 4 not-yet-implemented features (`FileReadStream`, `FileWriteStream`,
`Utf8Stream`, `mkdtempDisposableSync`).

## Test plan
- [x] `cargo build --bin deno` passes
- [x] `deno lint ext/node/polyfills/fs.ts` passes
- [x] Verified with ESM and CJS comparison scripts against Node.js
- [ ] CI green

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Changed files:
filename: ext/node/polyfills/fs.ts
patch: @@ -155,27 +155,6 @@ const {
   Uint8Array,
 } = primordials;
 
-const {
-  F_OK,
-  R_OK,
-  W_OK,
-  X_OK,
-  O_RDONLY,
-  O_WRONLY,
-  O_RDWR,
-  O_NOCTTY,
-  O_TRUNC,
-  O_APPEND,
-  O_DIRECTORY,
-  O_NOFOLLOW,
-  O_SYNC,
-  O_DSYNC,
-  O_SYMLINK,
-  O_NONBLOCK,
-  O_CREAT,
-  O_EXCL,
-} = constants;
-
 // -- stat --
 
 import {
@@ -233,18 +212,6 @@ function stat(
   );
 }
 
-const statPromise = promisify(stat) as (
-  & ((path: string | Buffer | URL) => Promise<Stats>)
-  & ((
-    path: string | Buffer | URL,
-    options: { bigint: false },
-  ) => Promise<Stats>)
-  & ((
-    path: string | Buffer | URL,
-    options: { bigint: true },
-  ) => Promise<BigIntStats>)
-);
-
 function statSync(path: string | Buffer | URL): Stats;
 function statSync(
   path: string | Buffer | URL,
@@ -336,11 +303,6 @@ function realpath(
 
 realpath.native = realpath;
 
-const realpathPromise = promisify(realpath) as (
-  path: string | Buffer,
-  options?: RealpathOptions,
-) => Promise<string | Buffer>;
-
 function realpathSync(
   path: string,
   options?: RealpathOptions | RealpathEncoding,
@@ -641,17 +603,6 @@ function statfsSync(
   }
 }
 
-const statfsPromise = promisify(statfs) as (
-  & ((
-    path: string | Buffer | URL,
-    options?: { bigint?: false },
-  ) => Promise<StatFs<number>>)
-  & ((
-    path: string | Buffer | URL,
-    options: { bigint: true },
-  ) => Promise<StatFs<bigint>>)
-);
-
 function access(
   path: string | Buffer | URL,
   mode: number | CallbackWithError,
@@ -3036,7 +2987,6 @@ export default {
   Dirent,
   exists,
   existsSync,
-  F_OK,
   fchmod,
   fchmodSync,
   fchown,
@@ -3067,20 +3017,6 @@ export default {
   mkdirSync,
   mkdtemp,
   mkdtempSync,
-  O_APPEND,
-  O_CREAT,
-  O_DIRECTORY,
-  O_DSYNC,
-  O_EXCL,
-  O_NOCTTY,
-  O_NOFOLLOW,
-  O_NONBLOCK,
-  O_RDONLY,
-  O_RDWR,
-  O_SYMLINK,
-  O_SYNC,
-  O_TRUNC,
-  O_WRONLY,
   open,
   openAsBlob,
   openSync,
@@ -3089,7 +3025,6 @@ export default {
   read,
   readSync,
   promises,
-  R_OK,
   readdir,
   readdirSync,
   readFile,
@@ -3121,18 +3056,15 @@ export default {
   unwatchFile,
   utimes,
   utimesSync,
-  W_OK,
   watch,
   watchFile,
-  watchPromise,
   write,
   writeFile,
   writev,
   writevSync,
   writeFileSync,
   WriteStream,
   writeSync,
-  X_OK,
   // For tests
   _toUnixTimestamp,
 };
@@ -3167,7 +3099,6 @@ export {
   Dirent,
   exists,
   existsSync,
-  F_OK,
   fchmod,
   fchmodSync,
   fchown,
@@ -3198,27 +3129,12 @@ export {
   mkdirSync,
   mkdtemp,
   mkdtempSync,
-  O_APPEND,
-  O_CREAT,
-  O_DIRECTORY,
-  O_DSYNC,
-  O_EXCL,
-  O_NOCTTY,
-  O_NOFOLLOW,
-  O_NONBLOCK,
-  O_RDONLY,
-  O_RDWR,
-  O_SYMLINK,
-  O_SYNC,
-  O_TRUNC,
-  O_WRONLY,
   open,
   openAsBlob,
   opendir,
   opendirSync,
   openSync,
   promises,
-  R_OK,
   read,
   readdir,
   readdirSync,
@@ -3232,7 +3148,6 @@ export {
   readvPromise,
   readvSync,
   realpath,
-  realpathPromise,
   realpathSync,
   rename,
   renameSync,
@@ -3242,9 +3157,7 @@ export {
   rmSync,
   stat,
   statfs,
-  statfsPromise,
   statfsSync,
-  statPromise,
   Stats,
   statSync,
   symlink,
@@ -3256,7 +3169,6 @@ export {
   unwatchFile,
   utimes,
   utimesSync,
-  W_OK,
   watch,
   watchFile,
   watchPromise,
@@ -3267,5 +3179,4 @@ export {
   writeSync,
   writev,
   writevSync,
-  X_OK,
 };