diff --git a/doc/api/fs.md b/doc/api/fs.md index 60570289a260fe..2fc237675b71da 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3679,7 +3679,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 dc3a0f7ae25868..d04f1cde045cca 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1839,13 +1839,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 2e45854dbae7b4..4ac43bfc8c07d4 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')