$ npm 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
© 2010 - cnpmjs.org x YWFE | Home | YWFE