Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 12th Jul 2022, 07:33 AM   #1
New Warrior Member
 
NamanRathore's Avatar
 
Join Date: 2022
Location: India
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default
Sending command line arguments to npm script
Share on: 
fb share twitter share gplus share more share

The scripts portion of my package.json currently looks like this:

Code:
"scripts": {
    "start": "node ./script.js server"
}
which means I can run npm start to start the server. So far so good.

However, I would like to be able to run something like npm start 8080 and have the argument(s) passed to script.js (e.g. npm start 8080 => nodes ./script.js server 8080). Is this conceivable?
NamanRathore is offline  
Unread 23rd Aug 2022, 03:27 PM   #2
Valina
 
Join Date: 2022
Location: pakistan
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Default
RE: Sending command line arguments to npm script
Share on: 
fb share twitter share gplus share more share

The 'vumper' package takes in a command line argument (such as 'dv'). What I would like to be able to do is have a command that runs both of these in succession.
valina g is offline  
Closed Thread


Bookmarks

Tags
arguments, command, line, npm, script, sending


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 03:20 AM.