@cjser/fn-name
v4.0.0-cjser.2
Published
Get the name of a named function
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-nameUsage
import functionName from 'fn-name';
functionName(function foo() {});
//=> 'foo'cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/fn-name
