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.
- Host: GitHub
- URL: https://github.com/lamansky/class-ancestors
- Owner: lamansky
- License: mit
- Created: 2017-02-14T09:51:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-27T16:02:50.000Z (over 9 years ago)
- Last Synced: 2025-06-10T19:07:36.675Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license.txt
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']
```