class-ancestors

    1.0.1 • Public • Published

    class-ancestors

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

    Installation

    npm install class-ancestors --save

    Usage

    const getClassAncestors = require('class-ancestors')
     
    class A {}
    class B extends A {}
    class C extends B {}
     
    getClassAncestors(C) // [B, A]
    getClassAncestors.names(C) // ['B', 'A']

    Install

    npm i class-ancestors

    DownloadsWeekly Downloads

    9

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • lamansky