Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  ..
  index.js
  package.json
  readme.md
  license
Size: Mime:

fn-name Build Status

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

const fnName = require('fn-name');

fnName(function foo() {});
//=> 'foo'