fn-name
v4.0.0
Published
Get the name of a named function
Downloads
4,473,674
Readme
fn-name
Get the name of a named function
There is a name
property on functions, but it's not supported in all browsers. This module tries that property then falls back to extracting the name from the function source.
Install
$ npm install fn-name
Usage
import functionName from 'fn-name';
functionName(function foo() {});
//=> 'foo'