3.0.0 • Published 7 months ago

get-func-name v3.0.0

Weekly downloads
3,285,544
License
MIT
Repository
github
Last release
7 months ago

What is get-func-name?

This is a module to retrieve a function's name securely and consistently both in NodeJS and the browser.

Installation

Node.js

get-func-name is available on npm. To install it, type:

$ npm install get-func-name

Browsers

You can also use it within the browser; install via npm and use the get-func-name.js file found within the download. For example:

<script src="./node_modules/get-func-name/get-func-name.js"></script>

Usage

The module get-func-name exports the following method:

  • getFuncName(fn) - Returns the name of a function.
var getFuncName = require('get-func-name');

.getFuncName(fun)

var getFuncName = require('get-func-name');

var unknownFunction = function myCoolFunction(word) {
   return word + 'is cool'; 
};

var anonymousFunction = (function () {
    return function () {};
}());

getFuncName(unknownFunction) // 'myCoolFunction'
getFuncName(anonymousFunction) // ''
check-error@sonammalhotra/lotide@smishra17/lotide@cheapthrills/lotide@cujo-common/simple-hello-world-example@iobroker-community-adapters/iobroker.device-watcher@newhorizon-tech/dd-npm-package-template@nicholasjj/lotide@infinitebrahmanuniverse/nolb-get-f@everything-registry/sub-chunk-1751@manwelj/lotideroyman-experiment-npm-publish@garycui222/lotide@haijoon2/lotidee@erikandersonwebdev/lotide@erkanegesenli/lotide@ericmcornelius/ease@hiroyone/number-formatter@hieuquang2212/form@hassanabdi/lotide@harinderlabana/lotideenefti-galeri@inovando-boletos/boleto@igniswap/igni-swap-lib@innoswap/chainlink-whitelist@innoswap/core@innoswap/default-token-list@eliteswap/v2-core@efeerkmen/lotide@eki-group/svelvetdynamics-contracts-x@fabwcie/ckeditor5-previewshainaexpressivestringsshadow-event-bus@iridium7/lotide@jenlaw266/lotide@jiaqi13/lotide@jjsmile/lotide@kevchew/lotide@kiwanoswap/v2-core@kirrosh/ptssparse-set@khainh/mongoose-delete@kodinghandle/bullswap-lib@krwhitley/neatapticgassefals-2gassefals@lilyhabbs/lotide@lianc/lotide@luiscontreras/lotide@lul-merina/lotide@louismcoding/lotide@litedexdev/litedex-core-swap@litedexdev/litedexdev-default-token-list@lxfater/windows-scheduler@programming_code/lotideip-design@qekj/testpackagejuicyvo@raijenken27/lotide@rstock.co/lotidek0mmand3r@saba072/lotide@rgosain/lotidevue-router-generator@kacao/chops@itayn-fireberry-org/itayn-test@j-pilon/lotide@jacquikoroll/lotide@jarrettk/lotide@kcruz95/lotidefixed_form_builder@kalkanisys/vue-select@mhassan47/lotide@metabitswap/default-token-list@meteora277/lotide@mar10outof10/lotide@niubrandon/lotide@mrludovic/lotide@nodeberry/solidity-payment-processortip4@nighly/sort-object-array-by-property@nirin100/quadratic-protocol@nirin100/quadratic-sdktinymce-plugin-toy@seunsoetan/lotide@shams.hameed/lotide@shilpashaji1204/lotide@skedulr/nebula-ui-library@segvndo/lotide@shovon/lotide@scee/lotide@parallelnft/web3modal@pearl-d/lotideui4html@perdieminc/models@ramiccodes/lotide@rdhbust/lotidehybrid-chai
2.0.2

7 months ago

3.0.0

7 months ago

2.0.1

7 months ago

2.0.0

7 years ago

1.0.0

8 years ago