1

I have a package.json that has a run script. I like to know is there a way I can run a script with variable command entered from the terminal

example:

{
  "scripts": {
    "dev": "react-native start --port={port from terminal} && npm run ios --port={port from terminal}"
  }
}

Then in terminal yarn run dev --port=7000

1 Answers1

1

Based on answer you can do this by adding -- before your [-- <args>]

Example:

npm run server -- --port=1337