diff --git a/doc/api/fs.md b/doc/api/fs.md index e65f6c7d4d2885..ec6d931e140fb5 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3686,7 +3686,7 @@ this API: [`fs.write(fd, string...)`][]. ## fs Promises API -> Stability: 1 - Experimental +> Stability: 2 - Stable The `fs.promises` API provides an alternative set of asynchronous file system methods that return `Promise` objects rather than using callbacks. The diff --git a/lib/fs.js b/lib/fs.js index e5abc59b591d22..3a299145ff5f8d 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1894,13 +1894,10 @@ Object.defineProperties(fs, { }, promises: { configurable: true, - enumerable: false, + enumerable: true, get() { - if (promises === null) { + if (promises === null) promises = require('internal/fs/promises'); - process.emitWarning('The fs.promises API is experimental', - 'ExperimentalWarning'); - } return promises; } } diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js index 97b5f8326e6052..cdafc11e21a854 100644 --- a/test/parallel/test-fs-promises.js +++ b/test/parallel/test-fs-promises.js @@ -40,9 +40,8 @@ function nextdir() { return `test${++dirc}`; } -// fs.promises should not be enumerable as long as it causes a warning to be -// emitted. -assert.strictEqual(Object.keys(fs).includes('promises'), false); +// fs.promises should not enumerable. +assert.strictEqual(Object.keys(fs).includes('promises'), true); { access(__filename, 'r')