I only get [Function] when I try to display the function :
> var a = function(){ return 'toto'; }
undefined
> a
[Function]
> require('util').inspect(a)
'[Function]'
Use toString
:
> var a = function(){ return 'toto'; }
undefined
> a.toString()
'function (){ return \'toto\'; }'