feat(fs.graceful-fs): expose promisified chmod and unlink (#11413)

* feat(fs.graceful-fs): expose promisified chmod and unlink

So callers can perform mode changes and removals through the same
EMFILE/ENFILE-queueing layer as the other operations.

* chore: remove ENFILE word to satisfy cspell
This commit is contained in:
Zoltan Kochan
2026-04-30 22:42:28 +02:00
parent 6b891a552a
commit 5a901e7957
2 changed files with 7 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/fs.graceful-fs": minor
---
Add `chmod` and `unlink` (promisified) to the exported fs interface so callers can perform mode changes and removals through the same EMFILE-queueing layer as the other operations.

View File

@@ -3,6 +3,7 @@ import util, { promisify } from 'node:util'
import gfs from 'graceful-fs'
export default { // eslint-disable-line
chmod: promisify(gfs.chmod),
copyFile: promisify(gfs.copyFile),
copyFileSync: withEagainRetry(gfs.copyFileSync),
createReadStream: gfs.createReadStream,
@@ -16,6 +17,7 @@ export default { // eslint-disable-line
readdirSync: gfs.readdirSync,
stat: promisify(gfs.stat),
statSync: gfs.statSync,
unlink: promisify(gfs.unlink),
unlinkSync: gfs.unlinkSync,
writeFile: promisify(gfs.writeFile),
writeFileSync: withEagainRetry(gfs.writeFileSync),