nodejs全局变量process属性值

新建一个js文件,例如名字为:test.js 键入以下内容:

console.log(process);

保存,命令行执行:node test.js 即可看到process变量的属性值列表:

{
  title: 'C:\\Windows\\system32\\cmd.exe - node	test.js',
	version: 'v0.10.13',
	moduleLoadList:
		[ 'Binding evals',
		 'Binding natives',
		 'NativeModule events',
		 'NativeModule buffer',
		 'Binding buffer',
		 'NativeModule assert',
		 'NativeModule util',
		 'NativeModule path',
		 'NativeModule module',
		 'NativeModule fs',
		 'Binding fs',
		 'Binding constants',
		 'NativeModule stream',
		 'NativeModule _stream_readable',
		 'NativeModule _stream_writable',
		 'NativeModule _stream_duplex',
		 'NativeModule _stream_transform',
		 'NativeModule _stream_passthrough',
		 'NativeModule http',
		 'NativeModule net',
		 'NativeModule timers',
		 'Binding timer_wrap',
		 'NativeModule _linklist',
		 'Binding cares_wrap',
		 'NativeModule url',
		 'NativeModule punycode',
		 'NativeModule querystring',
		 'NativeModule freelist',
		 'Binding http_parser',
		 'Binding tcp_wrap',
		 'NativeModule dns',
		 'NativeModule console',
		 'Binding tty_wrap',
		 'NativeModule tty',
		 'Binding signal_wrap' 
		],
	versions:{ http_parser: '1.0',
		 node: '0.10.13',
		 v8: '3.14.5.9',
		 ares: '1.9.0-DEV',
		 uv: '0.10.12',
		 zlib: '1.2.3',
		 modules: '11',
		 openssl: '1.0.1e' 
	},
	arch: 'x64',
	platform: 'win32',
	argv: [ 'node', 'D:\\GitHub\\requirejs\\localhost.js', 'test' ],
	execArgv: [],
	env:{ 
		ALLUSERSPROFILE: 'C:\\ProgramData',
		APPDATA: 'C:\\Users\\username\\AppData\\Roaming',
		'asl.log': 'Destination=file',
		ChocolateyInstall: 'C:\\Chocolatey',
		CLASS_PATH: '.;C:\\Program Files\\Java\\jdk1.7.0_25\\lib;C:\\Program File\\Java\\jdk1.7.0_25\\lib\\tools.jar',
		CommonProgramFiles: 'C:\\Program Files\\Common Files',
		'CommonProgramFiles(x86)': 'C:\\Program Files (x86)\\Common Files',
		CommonProgramW6432: 'C:\\Program Files\\Common Files',
		COMPUTERNAME: 'YJL',
		ComSpec: 'C:\\Windows\\system32\\cmd.exe',
		FP_NO_HOST_CHECK: 'NO',
		HOMEDRIVE: 'C:',
		HOMEPATH: '\\Users\\username',
		JAVA_HOME: 'C:\\Program Files\\Java\\jdk1.7.0_25',
		LOCALAPPDATA: 'C:\\Users\\username\\AppData\\Local',
		LOGONSERVER: '\\\\BB-MAIL-DC01',
		NODE_PATH: 'C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules',
		NUMBER_OF_PROCESSORS: '4',
		OS: 'Windows_NT',
		Path: 'path',
		PATHEXT: '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw'
		PROCESSOR_ARCHITECTURE: 'AMD64',
		PROCESSOR_IDENTIFIER: 'Intel64 Family ...'
		PROCESSOR_LEVEL: '6',
		PROCESSOR_REVISION: '2a07',
		ProgramData: 'C:\\ProgramData',
		ProgramFiles: 'C:\\Program Files',
		'ProgramFiles(x86)': 'C:\\Program Files (x86)',
		ProgramW6432: 'C:\\Program Files',
		PROMPT: '$P$G',
		PSModulePath: 'C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\'
		PUBLIC: 'C:\\Users\\Public',
		SESSIONNAME: 'Console',
		SystemDrive: 'C:',
		SystemRoot: 'C:\\Windows',
		TEMP: 'C:\\Users\\USERNAME\\AppData\\Local\\Temp',
		TMP: 'C:\\Users\\USERNAME\\AppData\\Local\\Temp',
		USERDNSDOMAIN: 'INTERNAL.BAIDU.COM',
		USERDOMAIN: 'INTERNAL',
		USERNAME: 'USERNAME',
		USERPROFILE: 'C:\\Users\\USERNAME',
		VBOX_INSTALL_PATH: 'C:\\Program Files\\Oracle\\VirtualBox\\',
		VISUALSVN_SERVER: 'C:\\Program Files (x86)\\VisualSVN Server\\',
		windir: 'C:\\Windows',
		windows_tracing_flags: '3',
		windows_tracing_logfile: 'C:\\BVTBin\\Tests\\installpackage\\csilogfile.l' 
	},
	pid: 5280,
	features:{ debug: false,
		uv: true,
		ipv6: true,
		tls_npn: true,
		tls_sni: true,
		tls: true 
	},
	_needImmediateCallback: false,
	execPath: 'D:\\Program Files\\nodejs\\node.exe',
	debugPort: 5858,
	_getActiveRequests: [Function],
	_getActiveHandles: [Function],
	_needTickCallback: [Function],
	reallyExit: [Function],
	abort: [Function],
	chdir: [Function],
	cwd: [Function],
	umask: [Function],
	_kill: [Function],
	_debugProcess: [Function],
	_debugPause: [Function],
	_debugEnd: [Function],
	hrtime: [Function],
	dlopen: [Function],
	uptime: [Function],
	memoryUsage: [Function],
	binding: [Function],
	_usingDomains: [Function],
	_tickInfoBox: { '0': 1, '1': 0, '2': 0 },
	_events: { SIGWINCH: [Function] },
	domain: null,
	_maxListeners: 10,
	EventEmitter: { [Function: EventEmitter] listenerCount: [Function] },
	_fatalException: [Function],
	_exiting: false,
	assert: [Function],
	config:{ target_defaults:
			{ cflags: [],
				default_configuration: 'Release',
				defines: [],
				include_dirs: [],
				libraries: [] },
		 variables:
			{ clang: 0,
				host_arch: 'ia32',
				node_install_npm: true,
				node_prefix: '',
				node_shared_cares: false,
				node_shared_http_parser: false,
				node_shared_libuv: false,
				node_shared_openssl: false,
				node_shared_v8: false,
				node_shared_zlib: false,
				node_tag: '',
				node_unsafe_optimizations: 0,
				node_use_dtrace: false,
				node_use_etw: true,
				node_use_openssl: true,
				node_use_perfctr: true,
				node_use_systemtap: false,
				python: 'C:\\Python27\\python.exe',
				target_arch: 'x64',
				v8_enable_gdbjit: 0,
				v8_no_strict_aliasing: 1,
				v8_use_snapshot: false,
				visibility: '' } },
	nextTick: [Function: nextTick],
	_nextDomainTick: [Function: _nextDomainTick],
	_tickCallback: [Function: _tickCallback],
	_tickDomainCallback: [Function: _tickDomainCallback],
	_tickFromSpinner: [Function: _tickFromSpinner],
	maxTickDepth: 1000,
	stdout: [Getter],
	stderr: [Getter],
	stdin: [Getter],
	openStdin: [Function],
	exit: [Function],
	kill: [Function],
	addListener: [Function],
	on: [Function],
	removeListener: [Function],
	mainModule:{ id: '.',
		exports: {},
		parent: null,
		filename: 'D:\\GitHub\\requirejs\\localhost.js',
		loaded: false,
		children: [ [Object] ],
		paths:
			[ 'D:\\GitHub\\requirejs\\node_modules',
				'D:\\GitHub\\node_modules',
				'D:\\node_modules' 
			] 
	}
}

这篇文章目前没有评论

Leave a Reply

(必填项)

(必填项)

(可选)