fn-name
Get the name of a named function
Last updated 4 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install fn-name 
SYNC missed versions from official npm registry.

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'

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Current Tags

  • 4.0.0                                ...           latest (4 years ago)

8 Versions

  • 4.0.0                                ...           4 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Downloads
Today 0
This Week 0
This Month 22
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (3)

Copyright 2013 - present © cnpmjs.org | Home |