Skip to content

Commit 66876dc

Browse files
committed
Fix tests and note that deprecated constants are not exported
Since nodejs/node#49686, they are not enumerable properties, so Object.assign doesn't re-export them. Attempting to directly export them would trigger the deprecation warning.
1 parent 7c1dc26 commit 66876dc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ const fs = require('fs')
5757
const fse = require('fs-extra')
5858
```
5959

60+
**NOTE:** The deprecated constants `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, & `fs.X_OK` are not exported on Node.js v24.0.0+; please use their `fs.constants` equivalents.
61+
6062
### ESM
6163

6264
There is also an `fs-extra/esm` import, that supports both default and named exports. However, note that `fs` methods are not included in `fs-extra/esm`; you still need to import `fs` and/or `fs/promises` seperately:

lib/fs/__tests__/fs-integration.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ describe('native fs', () => {
2727

2828
it('should have native fs constants', () => {
2929
assert.strictEqual(fse.constants.F_OK, fs.constants.F_OK)
30-
assert.strictEqual(fse.F_OK, fs.F_OK) // soft deprecated usage, but still available
3130
})
3231
})

0 commit comments

Comments
 (0)