fs: remove experimental warning for fs.promises
This has been warning for long enough, without any API changes in the last few months. PR-URL: https://github.com/nodejs/node/pull/26581 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
82bf240eba
commit
5583d4d73e
@ -3699,7 +3699,7 @@ this API: [`fs.write(fd, string...)`][].
|
|||||||
|
|
||||||
## fs Promises API
|
## fs Promises API
|
||||||
|
|
||||||
> Stability: 1 - Experimental
|
> Stability: 2 - Stable
|
||||||
|
|
||||||
The `fs.promises` API provides an alternative set of asynchronous file system
|
The `fs.promises` API provides an alternative set of asynchronous file system
|
||||||
methods that return `Promise` objects rather than using callbacks. The
|
methods that return `Promise` objects rather than using callbacks. The
|
||||||
|
@ -1930,13 +1930,10 @@ Object.defineProperties(fs, {
|
|||||||
},
|
},
|
||||||
promises: {
|
promises: {
|
||||||
configurable: true,
|
configurable: true,
|
||||||
enumerable: false,
|
enumerable: true,
|
||||||
get() {
|
get() {
|
||||||
if (promises === null) {
|
if (promises === null)
|
||||||
promises = require('internal/fs/promises');
|
promises = require('internal/fs/promises');
|
||||||
process.emitWarning('The fs.promises API is experimental',
|
|
||||||
'ExperimentalWarning');
|
|
||||||
}
|
|
||||||
return promises;
|
return promises;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,8 @@ function nextdir() {
|
|||||||
return `test${++dirc}`;
|
return `test${++dirc}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fs.promises should not be enumerable as long as it causes a warning to be
|
// fs.promises should not enumerable.
|
||||||
// emitted.
|
assert.strictEqual(Object.keys(fs).includes('promises'), true);
|
||||||
assert.strictEqual(Object.keys(fs).includes('promises'), false);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
access(__filename, 'r')
|
access(__filename, 'r')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user