Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaelzhang/node-util-inherits
node util.inherits with compatibility
https://github.com/kaelzhang/node-util-inherits
inherits node utility
Last synced: 2 months ago
JSON representation
node util.inherits with compatibility
- Host: GitHub
- URL: https://github.com/kaelzhang/node-util-inherits
- Owner: kaelzhang
- License: other
- Created: 2017-05-18T02:33:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-18T11:02:30.000Z (over 7 years ago)
- Last Synced: 2023-12-19T13:34:28.801Z (about 1 year ago)
- Topics: inherits, node, utility
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/kaelzhang/node-util-inherits.svg?branch=master)](https://travis-ci.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