We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
global
__dirname
__filename
exports
module
require()
setTimeout
queueMicrotask
setImmediate
process
Buffer
platform
cwd
chdir
env
npm install cross-env -g
argv
npm install commander
process.nextTick
The text was updated successfully, but these errors were encountered:
No branches or pull requests
全局变量
global
上的属性__dirname
绝对路径,指代的是当前文件所在的目录__filename
绝对路径,指代的是当前文件的路径exports
module
require()
global 中比较重要的属性
setTimeout
、queueMicrotask
、setImmediate
process
代表进程,可以获得运行时一些环境和参数Buffer
二进制数据容器,用于处理二进制数据;主要用于文件操作process 中的重要属性
platform
代码运行的平台(win32 => windows,darwin => mac);每个平台找一些用户文件,位置可能不一样cwd
当前工作目录(current working directory),运行时产生的一个路径,指向在哪里执行(可以改变)。相对路径相对的是工作目录,不是当前文件所在的目录。如果是一个确定的路径应使用绝对路径chdir
切换当前工作目录env
默认会读取全局的环境变量(也可以临时设置变量)npm install cross-env -g
全局安装 cross-env 设置临时的代码执行环境变量argv
用户执行时传递的参数;可以使用优秀的命令行管家解析命令行参数npm install commander
process.nextTick
The text was updated successfully, but these errors were encountered: