The scripts
portion of my package.json
currently looks like this: 个人package.json
的scripts
部分当前以下所示: node
"scripts": { "start": "node ./script.js server" }
...which means I can run npm start
to start the server. ...这意味着我能够运行npm start
来启动服务器。 So far so good. 到如今为止还挺好。 npm
However, I would like to be able to run something like npm start 8080
and have the argument(s) passed to script.js
(eg npm start 8080
=> node ./script.js server 8080
). 可是,我但愿可以运行npm start 8080
类的东西,并将参数传递给script.js
(例如npm start 8080
=> node ./script.js server 8080
)。 Is this possible? 这可能吗? json