diff --git a/lib/events.js b/lib/events.js index f57882ab6dc427..403f2d2ff8cea2 100644 --- a/lib/events.js +++ b/lib/events.js @@ -8,8 +8,13 @@ function EventEmitter() { } module.exports = EventEmitter; -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; +Object.defineProperty(EventEmitter, 'EventEmitter', { + get: internalUtil.deprecate(function() { + return EventEmitter; + }, + `require('events').EventEmitter is deprecated.` + + `Use require('events') instead.`) +}); EventEmitter.usingDomains = false; diff --git a/lib/module.js b/lib/module.js index ca2c805bb0da16..033ae81bb64003 100644 --- a/lib/module.js +++ b/lib/module.js @@ -516,5 +516,9 @@ Module._preloadModules = function(requests) { Module._initPaths(); -// backwards compatibility -Module.Module = Module; +Object.defineProperty(Module, 'Module', { + get: internalUtil.deprecate(function() { + return Module; + }, + `require('module').Module is deprecated. Use require('module') instead.`) +});