diff --git a/lib/fs.js b/lib/fs.js index 4b7ef8ffac9254..1eed27109465e0 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -86,12 +86,11 @@ const { validateUint32 } = require('internal/validators'); -let promisesWarn = true; let truncateWarn = true; let fs; // Lazy loaded -let promises; +let promises = null; let watchers; let ReadFileContext; @@ -1837,9 +1836,8 @@ Object.defineProperties(fs, { configurable: true, enumerable: false, get() { - if (promisesWarn) { + if (promises === null) { promises = require('internal/fs/promises'); - promisesWarn = false; process.emitWarning('The fs.promises API is experimental', 'ExperimentalWarning'); }