1.1.6 • Published 3 years ago

console-prototype v1.1.6

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

consoleprototype

This module expands the original console object and gains a prototype property. If you call this property over the console object and pass a javascript object as a parameter, it displays the object's prototype chain as a tree on the terminal.The purpose of the module is to be able to view object chains as in browsers.

install

    npm i console-prototype

usage

require('console-prototype') 

class AClass{
    constructor(){
        this.aProp = 'aProp'
    }

    getAprop(){
        return this.aProp
    }
}

class BClass extends AClass{
    constructor(){
        super()
        this.bProp = 'bProp'
    }

    getBprop(){
        return this.bProp
    }
}

class CClass extends BClass{
    constructor(){
        super()
        this.cProp = 'cProp'
    }

    getCprop(){
        return this.cProp
    }
}

class DClass extends CClass{
    constructor(){
        super()
        this.dProp = 'dProp'
    }

    getDprop(){
        return this.dProp
    }
}

const o = new DClass()
console.prototype(o)

out

alt text

usage 2

const consoleProto =require('console-prototype') 
const o = new DClass()
consoleProto(o)
1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago