Skip to content

Commit

Permalink
chore: add maintenance mode message (#4345)
Browse files Browse the repository at this point in the history
* chore: add maintenance mode message

* chore: update require location of maintenance mode message
  • Loading branch information
kuhe committed Feb 11, 2023
1 parent 895a934 commit 1477fdb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ require('./response');
require('./resource_waiter');
require('./signers/request_signer');
require('./param_validator');
require('./maintenance_mode_message');

/**
* @readonly
Expand Down
31 changes: 31 additions & 0 deletions lib/maintenance_mode_message.js
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);

0 comments on commit 1477fdb

Please sign in to comment.