| [](https://travis-ci.org/kaelzhang/node-util-inherits) | |
| <!-- optional appveyor tst | |
| [](https://ci.appveyor.com/project/kaelzhang/node-util-inherits) | |
| --> | |
| <!-- optional npm version | |
| [](http://badge.fury.io/js/util-inherits) | |
| --> | |
| <!-- optional npm downloads | |
| [](https://www.npmjs.org/package/util-inherits) | |
| --> | |
| <!-- optional dependency status | |
| [](https://david-dm.org/kaelzhang/node-util-inherits) | |
| --> | |
| # util-inherits | |
| util.inherits with compatibility. | |
| `util-inherits` will try use `Object.setPrototypeOf`, if `Object.setPrototypeOf` is not supported, then `Object.create`, or manipulate prototype. | |
| - Browser friendly. | |
| - Does not rely on node utilities | |
| ## Install | |
| ```sh | |
| $ npm install util.inherits --save | |
| ``` | |
| ## Usage | |
| ```js | |
| const inherits = require('util.inherits') | |
| const {EventEmitter} = require('events') | |
| function MyClass () { | |
| // code ... | |
| } | |
| inherits(MyClass, EventEmitter) | |
| ``` | |
| ## License | |
| MIT |