current-function

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i current-function

Weekly Downloads

3

Version

1.0.0

License

Apache-2.0

Unpacked Size

14 kB

Total Files

5

Last publish

Collaborators

  • bearjaws