util.inherits with compatibility.
util-inherits will try use Object.setPrototypeOf, if Object.setPrototypeOf is not supported, then Object.create, or manipulate prototype.
$ npm install util.inherits --save
const inherits = require('util.inherits') const {EventEmitter} = require('events') function MyClass () { // code ... } inherits(MyClass, EventEmitter)
MIT