mirror of
https://github.com/pnpm/pnpm.git
synced 2026-06-29 18:35:18 -04:00
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:
5
.changeset/graceful-fs-chmod-unlink.md
Normal file
5
.changeset/graceful-fs-chmod-unlink.md
Normal 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.
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user