使用console.dir 快速概览Node.JS中对象实例的属性和方法
2012-05-28 00:00
1146 查看
在Node.JS命令行中输入:
对照上面的“索引”查看console.js更方面
查看console.js中的dir函数定义
输入下列命令看看
查看内置的 process
> console.log(process.version) v0.6.14
> console.dir(console) { log: [Function], info: [Function], warn: [Function], error: [Function], dir: [Function], time: [Function], timeEnd: [Function], trace: [Function], assert: [Function] } undefined >
对照上面的“索引”查看console.js更方面
查看console.js中的dir函数定义
exports.dir = function(object) { process.stdout.write(util.inspect(object) + '\n'); };
输入下列命令看看
> console.dir(global)
查看内置的 process
> console.dir(process) { title: 'C:\\WINDOWS\\system32\\cmd.exe - node', EventEmitter: [Function: EventEmitter], version: 'v0.6.14', assert: [Function], moduleLoadList: [ 'Binding evals', 'Binding natives', 'NativeModule events', 'NativeModule buffer', 'Binding buffer', 'NativeModule assert', 'NativeModule util', 'NativeModule module', 'NativeModule path', 'NativeModule tty', 'NativeModule net', 'NativeModule stream', 'NativeModule timers', 'Binding timer_wrap', 'NativeModule _linklist', 'Binding tty_wrap', 'NativeModule vm', 'NativeModule fs', 'Binding fs', 'Binding constants', 'NativeModule readline', 'NativeModule console' ], _tickCallback: [Function], nextTick: [Function], versions: { node: '0.6.14', v8: '3.6.6.24', ares: '1.7.5-DEV', uv: '0.6', openssl: '0.9.8r' }, stdout: [Getter], arch: 'ia32', platform: 'win32', stderr: [Getter], argv: [ 'node' ], stdin: [Getter], openStdin: [Function], env: { ... NLS_LANG: 'SIMPLIFIED CHINESE_CHINA.ZHS16GBK', NUMBER_OF_PROCESSORS: '2', OS: 'Windows_NT', Path: '...//略; C:\\Program Files\\nodejs\\,;...//略 PATHEXT: '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1', PROCESSOR_ARCHITECTURE: 'x86', PROCESSOR_IDENTIFIER: 'x86 Family 6 Model 23 Stepping 10, GenuineIntel', PROCESSOR_LEVEL: '6', PROCESSOR_REVISION: '170a', ProgramFiles: 'C:\\Program Files', PROMPT: '$P$G', ...//略 SESSIONNAME: 'Console', ...//略 windir: 'C:\\WINDOWS' }, exit: [Function], pid: 2900, features: { debug: false, uv: true, ipv6: true, tls_npn: true, tls_sni: true, tls: true }, kill: [Function], addListener: [Function], execPath: 'C:\\Program Files\\nodejs\\node.exe', _needTickCallback: [Function], on: [Function], removeListener: [Function], reallyExit: [Function], debug: [Function], chdir: [Function], error: [Function], cwd: [Function], umask: [Function], watchFile: [Function], _kill: [Function], unwatchFile: [Function], mixin: [Function], _debugProcess: [Function], dlopen: [Function], createChildProcess: [Function], uptime: [Function], inherits: [Function], _byteLength: [Function], memoryUsage: [Function], uvCounters: [Function], _events: { SIGWINCH: [ [Function] ] }, binding: [Function] } undefined
相关文章推荐
- node.js中的console.dir方法使用说明
- node.js中的console.dir方法使用说明
- node.js中的console.log方法使用说明
- node.js中的console.error方法使用说明
- node.js---koa框架,mysql查询后Promise对象使用方法返回json对象。
- node.js中的console.warn方法使用说明
- node.js中的console.info方法使用说明
- node.js中的console.info方法使用说明
- JS获得一个对象的所有属性和方法实例
- ajax 快速入门,ajax底层使用的五个步骤;XMLHttpRequest对象详解;XMLHttpRequest常用属性;XMLHttpRequest常用方法
- node.js中的console.trace方法使用说明
- node.js中的console.time方法使用说明
- node.js中的console.assert方法使用说明
- 在js对象中定义属性和方法的实例。
- js 中使用indexOf()方法是提示(对象不支持此属性或方法)如何解决?
- node.js中的console.timeEnd方法使用说明
- mybatis从dao传入多个参数到sqlmap时dao中要使用map或实例对象(如:user)作为参数传入, 否则报错找不到属性getter方法
- node.js中的console.warn方法使用说明
- Node.js使用MySQL连接池的方法实例
- JS 使用List<Object> 对象中的Object对象的某个属性的临时处理方法