-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add maintenance mode message (#4345)
* chore: add maintenance mode message * chore: update require location of maintenance mode message
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var warning = [ | ||
'The AWS SDK for JavaScript (v2) will be put into maintenance mode in 2023.\n', | ||
'Please migrate your code to use AWS SDK for JavaScript (v3).', | ||
'For more information, check the migration guide at https://a.co/7PzMCcy' | ||
].join('\n'); | ||
|
||
module.exports = { | ||
suppress: false | ||
}; | ||
|
||
/** | ||
* To suppress this message: | ||
* @example | ||
* require('aws-sdk/lib/maintenance_mode_message').suppress = true; | ||
*/ | ||
function emitWarning() { | ||
if ( | ||
typeof process !== 'undefined' && | ||
typeof process.emitWarning === 'function' | ||
) { | ||
process.emitWarning(warning, { | ||
type: 'NOTE' | ||
}); | ||
} | ||
} | ||
|
||
setTimeout(function () { | ||
if (!module.exports.suppress) { | ||
emitWarning(); | ||
} | ||
}, 0); |