fn-name

Get the name of a named function

MIT 8 个版本
安装
npm install fn-name
yarn add fn-name
pnpm add fn-name
bun add fn-name
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'

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.
版本列表
4.0.0 2021-04-07
3.0.0 2019-09-10
2.0.1 2015-09-25
2.0.0 2014-11-27
1.0.1 2014-08-13
0.2.0 2014-04-29
0.1.1 2014-04-29
0.1.0 2013-12-01