diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-03-11 13:19:47 +0300 |
---|---|---|
committer | Beth Griggs <Bethany.Griggs@uk.ibm.com> | 2019-10-16 23:49:56 +0300 |
commit | 85ce8ef19ab84ff57a1483f3af545b2336f111c1 (patch) | |
tree | 7bb357585d3c2fa77589668286ca86fb7e492f15 | |
parent | 69bf5b79446c9f2ecefe6d75d2a105b8e3d078a1 (diff) |
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>
-rw-r--r-- | doc/api/fs.md | 2 | ||||
-rw-r--r-- | lib/fs.js | 7 | ||||
-rw-r--r-- | test/parallel/test-fs-promises.js | 5 |
3 files changed, 5 insertions, 9 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index 60570289a26..2fc237675b7 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 dc3a0f7ae25..d04f1cde045 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 2e45854dbae..4ac43bfc8c0 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') |