3 [![Build][build-badge]][build]
4 [![Coverage][coverage-badge]][coverage]
5 [![Downloads][downloads-badge]][downloads]
6 [![Size][size-badge]][size]
8 Create a custom constructor which can be modified without affecting the original
22 var EventEmitter = require('events').EventEmitter
23 var unherit = require('unherit')
25 // Create a private class which acts just like `EventEmitter`.
26 var Emitter = unherit(EventEmitter)
28 Emitter.prototype.defaultMaxListeners = 0
29 // Now, all instances of `Emitter` have no maximum listeners, without affecting
30 // other `EventEmitter`s.
32 new Emitter().defaultMaxListeners === 0 // => true
33 new EventEmitter().defaultMaxListeners === undefined // => true
34 new Emitter() instanceof EventEmitter // => true
41 Create a custom constructor which can be modified without affecting the original
46 * `Super` (`Function`) — Super-class
50 `Function` — Constructor acting like `Super`, which can be modified without
51 affecting the original class.
55 [MIT][license] © [Titus Wormer][author]
59 [build-badge]: https://img.shields.io/travis/wooorm/unherit.svg
61 [build]: https://travis-ci.org/wooorm/unherit
63 [coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/unherit.svg
65 [coverage]: https://codecov.io/github/wooorm/unherit
67 [downloads-badge]: https://img.shields.io/npm/dm/unherit.svg
69 [downloads]: https://www.npmjs.com/package/unherit
71 [size-badge]: https://img.shields.io/bundlephobia/minzip/unherit.svg
73 [size]: https://bundlephobia.com/result?p=unherit
75 [npm]: https://docs.npmjs.com/cli/install
79 [author]: https://wooorm.com