class-chain

Returns an object’s class and its ancestors.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
class-chain
201.0.06 years ago6 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']