Skip to content

Commit

Permalink
fs: remove experimental warning for fs.promises
Browse files Browse the repository at this point in the history
This has been warning for long enough, without any API changes
in the last few months.

PR-URL: #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>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
addaleax authored and BethGriggs committed Apr 9, 2019
1 parent ecac654 commit 3e386a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
5 changes: 2 additions & 3 deletions test/parallel/test-fs-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 3e386a7

Please sign in to comment.