An open API service indexing awesome lists of open source software.

https://github.com/lamansky/class-chain

[Node.js] Returns an object’s class and its ancestors.
https://github.com/lamansky/class-chain

ancestors class javascript nodejs parent-class

Last synced: about 1 month ago
JSON representation

[Node.js] Returns an object’s class and its ancestors.

Awesome Lists containing this project

README

        

# class-chain

A [Node.js](https://nodejs.org/) module that returns an object’s class and its ancestors.

## Installation

```bash
npm install class-chain --save
```

## Usage

```javascript
const getClassChain = require('class-chain')

class A {}
class B extends A {}

let b = new B()

getClassChain(b) // [B, A]
getClassChain.names(b) // ['B', 'A']
```