I have a web server written in Node.js and I would like to launch with a specific folder.
(我有一个用Node.js编写的Web服务器,我想使用一个特定的文件夹启动。)
I'm not sure how to access arguments in JavaScript.(我不确定如何在JavaScript中访问参数。)
I'm running node like this:(我正在像这样运行节点:)
$ node server.js folder
here server.js
is my server code.
(这是server.js
是我的服务器代码。)
Node.js help says this is possible:(Node.js帮助说这是可能的:)
$ node -h
Usage: node [options] script.js [arguments]
How would I access those arguments in JavaScript?
(如何在JavaScript中访问这些参数?)
Somehow I was not able to find this information on the web.(不知何故,我无法在网上找到此信息。)
ask by milkplus translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…