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.
- Host: GitHub
- URL: https://github.com/lamansky/class-chain
- Owner: lamansky
- License: mit
- Created: 2017-02-13T20:25:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-13T20:34:04.000Z (over 8 years ago)
- Last Synced: 2025-04-14T20:18:32.675Z (about 2 months ago)
- Topics: ancestors, class, javascript, nodejs, parent-class
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
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']
```