$ gnpm install get-function-name
Get the name of a function
With npm
npm install get-function-name
Node.js
var getFunctionName = require('get-function-name')
var foo = function() {}
function bar() {}
getFunctionName(foo) // 'anonymous'
getFunctionName(bar) // 'bar'
getFunctionName('hello') // null
Copyright 2013 - present © cnpmjs.org | Home |