get-function-name

0.0.1 • Public • Published

get-function-name

Get the name of a function

Install

With npm

npm install get-function-name

Usage

Node.js

var getFunctionName = require('get-function-name')
 
var foo = function() {}
function bar() {}
 
getFunctionName(foo) // 'anonymous'
getFunctionName(bar) // 'bar'
getFunctionName('hello') // null

Readme

Keywords

Package Sidebar

Install

npm i get-function-name

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • sorensen