I have a function:
fs.readFile = function(filename, callback) {
// implementation code.
};
Sometime later I want to see the signature of the function during debugging.
When I tried console.log(fs.readFile)
I get [ FUNCTION ]
.
That does not give me any information.
How can I get the signature of the function?
fs.readFile
: nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callbackfunctionname.toString().match(/function\s*(.*?)\s*{/)[1]