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

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

A Node.js module which returns an array containing the ancestors of a given class.
https://github.com/lamansky/class-ancestors

Last synced: 2 months ago
JSON representation

A Node.js module which returns an array containing the ancestors of a given class.

Awesome Lists containing this project

README

          

# class-ancestors

A [Node.js](https://nodejs.org/) module which returns an array containing the ancestors of a given class.

## Installation

```bash
npm install class-ancestors --save
```

## Usage

```javascript
const getClassAncestors = require('class-ancestors')

class A {}
class B extends A {}
class C extends B {}

getClassAncestors(C) // [B, A]
getClassAncestors.names(C) // ['B', 'A']
```