From fe318dd095ffb8f7233231c93d9d4d6b4caaf96a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 8 Sep 2020 00:10:44 +0200 Subject: [PATCH] punycode: add pending deprecation PR-URL: https://github.com/nodejs/node/pull/46719 Reviewed-By: Rich Trott Reviewed-By: Paolo Insogna --- lib/punycode.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/punycode.js b/lib/punycode.js index 752b98a9fde674..d99588c7aec8f4 100644 --- a/lib/punycode.js +++ b/lib/punycode.js @@ -1,5 +1,15 @@ 'use strict'; +const { getOptionValue } = require('internal/options'); +if (getOptionValue('--pending-deprecation')){ + process.emitWarning( + 'The `punycode` module is deprecated. Please use a userland ' + + 'alternative instead.', + 'DeprecationWarning', + 'DEP0040', + ); +} + /** Highest positive signed 32-bit float value */ const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1