class-chain

Returns an object’s class and its ancestors.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
class-chain
1.0.07 years ago7 years agoMinified + gzip package size for class-chain in KB

Readme

class-chain
A Node.js module that returns an object’s class and its ancestors.

Installation

npm install class-chain --save

Usage

const getClassChain = require('class-chain')

class A {}
class B extends A {}

let b = new B()

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