1.0.0 • Published 7 years ago

current-function v1.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

Easy way to get the current calling functions name, even with 'use strict'!

Example Usage: const currentFunction = require('current-function');

function withName() {
    console.log(currentFunction());
}

returns withName

class Testing {

    anotherName() {
        console.log(currentFunction());
    }
}

let testing = new Testing();
testing.anotherName();

returns Testing.anotherName