任意新建一个js文件,只需一行代码:

console.dir(process);

保存该文件后执行,即可得到process变量的属性值列表:

 {
title: 'node',
version: 'v0.10.30',
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 console',
'Binding tty_wrap',
'NativeModule tty',
'NativeModule net',
'NativeModule timers',
'Binding timer_wrap',
'NativeModule _linklist',
'Binding cares_wrap',
'Binding signal_wrap'
],
versions: {
http_parser: '1.0',
node: '0.10.30',
v8: '3.14.5.9',
ares: '1.9.0-DEV',
uv: '0.10.28',
zlib: '1.2.3',
modules: '11',
openssl: '1.0.1h'
},
arch: 'x64',
platform: 'darwin',
argv: ['node', '/Users/baidu/github/test/b.js'],
execArgv: [],
env: {
MANPATH: '/Users/baidu/.nvm/v0.10.30/share/man:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/man:/usr/local/share/man:/usr/share/man:/opt/X11/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man',
TERM_PROGRAM: 'Apple_Terminal',
TERM: 'xterm-256color',
SHELL: '/bin/bash',
TMPDIR: '/var/folders/x4/ph44fxq90_99lq3wb24b11sw0000gn/T/',
NVM_PATH: '/Users/baidu/.nvm/v0.10.30/lib/node',
Apple_PubSub_Socket_Render: '/private/tmp/com.apple.launchd.OV6WFhpAzS/Render',
TERM_PROGRAM_VERSION: '343.6',
TERM_SESSION_ID: 'E3666AE1-2E72-484B-978A-8D319AE91FA7',
SVN_EDITOR: 'sub',
NVM_DIR: '/Users/baidu/.nvm',
USER: 'baidu',
SSH_AUTH_SOCK: '/private/tmp/com.apple.launchd.6RgvKm8VMV/Listeners',
__CF_USER_TEXT_ENCODING: '0x1F5:0x19:0x34',
MAVEN_HOME: '/usr/local/Cellar/maven/3.2.2/libexec',
PATH: '/Users/baidu/.nvm/v0.10.30/bin:/Users/baidu/Documents/myDocument/fcinst/bin:/Applications/MAMP/bin/php/php5.5.14/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin:/usr/local/fcinst/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin',
NVM_NODEJS_ORG_MIRROR: 'http://nodejs.org/dist',
PWD: '/Users/baidu/github/test',
JAVA_HOME: '/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home',
LANG: 'zh_CN.UTF-8',
NODE_PATH: '/Users/baidu/.nvm/v0.10.30/lib/node_modules',
XPC_FLAGS: '0x0',
XPC_SERVICE_NAME: '0',
HOME: '/Users/baidu',
SHLVL: '1',
LOGNAME: 'baidu',
MAVEN: '/usr/local/Cellar/maven/3.2.2/libexec/bin',
CLASSPATH: ':/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/tools.jar',
NVM_BIN: '/Users/baidu/.nvm/v0.10.30/bin',
DISPLAY: '/private/tmp/com.apple.launchd.SVvs5bqsWe/org.macosforge.xquartz:0',
SECURITYSESSIONID: '186a5',
_: '/Users/baidu/.nvm/v0.10.30/bin/node',
OLDPWD: '/Users/baidu/github'
},
pid: 2719,
features: {
debug: false,
uv: true,
ipv6: true,
tls_npn: true,
tls_sni: true,
tls: true
},
_needImmediateCallback: false,
execPath: '/Users/baidu/.nvm/v0.10.30/bin/node',
debugPort: 5858,
_getActiveRequests: [Function],
_getActiveHandles: [Function],
_needTickCallback: [Function],
reallyExit: [Function],
abort: [Function],
chdir: [Function],
cwd: [Function],
umask: [Function],
getuid: [Function],
setuid: [Function],
setgid: [Function],
getgid: [Function],
getgroups: [Function],
setgroups: [Function],
initgroups: [Function],
_kill: [Function],
_debugProcess: [Function],
_debugPause: [Function],
_debugEnd: [Function],
hrtime: [Function],
dlopen: [Function],
uptime: [Function],
memoryUsage: [Function],
binding: [Function],
_usingDomains: [Function],
_tickInfoBox: {
'0': 0,
'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: 1,
host_arch: 'x64',
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: true,
node_use_etw: false,
node_use_openssl: true,
node_use_perfctr: false,
python: '/usr/bin/python',
target_arch: 'x64',
v8_enable_gdbjit: 0,
v8_no_strict_aliasing: 1,
v8_use_snapshot: false,
want_separate_host_toolset: 0
}
},
nextTick: [Function: nextTick],
_currentTickHandler: [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: '/Users/baidu/github/test/b.js',
loaded: false,
children: [],
paths: ['/Users/baidu/github/test/node_modules',
'/Users/baidu/github/node_modules',
'/Users/baidu/node_modules',
'/Users/node_modules',
'/node_modules'
]
}
}
05-11 21:48