Node.js:process.argv 与 process.ARGV
我注意到 Node 定义了 process.argv 和 process.ARGV (大写)。后者在文档中没有提及,并且在我迄今为止遇到的每种情况下都是同一个对象。
ARGV
只是历史遗留问题,还是有其目的?
I notice that Node defines both process.argv
and process.ARGV
(capitalized). The later isn't mentioned in the documentation and is, in every case I've encountered so far, the same object.
Is ARGV
just a historic holdover, or does it have a purpose?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
process.ARGV
自v0 以来已完全删除 .5.10
。process.ARGV
has been removed entirely sincev0.5.10
.它们是相同的:
node.cc
编辑(基于进一步的问题):
只有一个人可以肯定地告诉你这一点(作者) - 你也许能够在 IRC (
irc.freenode.net #node.js
) 上找到他。查看其他符号,我猜测它是为了一致性而添加的 -
argv
和env
似乎是唯一同时具有小写和大写版本的两个符号。但是,ENV
与env
略有不同。也许作者认为argv
和ARGV
可能与env
和ENV
的差异相同?They are identical:
node.cc
Edit (based on further question):
There's only one person who can tell you that for sure (the author) - you might be able to find him on IRC (
irc.freenode.net #node.js
).Looking through the other symbols, I'd guess that it was added for consistency -
argv
andenv
seem to be the only two that have both lower and upper case versions. However,ENV
differs slightly fromenv
. Maybe the author thought thatargv
andARGV
might differ in the same manner asenv
andENV
?