获取node.js中当前定义的函数列表
有什么函数可以用来列出node.js中所有当前定义的函数吗? 我想创build一个这样的function:
function getAllDefinedFunctions(){ //return all the functions that are currently defined }
你可以使用for / in
循环遍历this
(全局对象)中的所有属性,并检查typeof this[name]
是否是'function'
。