Within my package.json
, I have the following script:
"dev": "webpack-dev-server --config webpack.dev.js --progress --port ${getPort()}",
I've also installed a package called get-port, which allows me to set a default port and obtain an alternative if the default is in use.
I'm interested in utilizing this dependency to retrieve the port for the script mentioned above (where getPort()
is indicated). How can I execute JavaScript inline and capture the returned value from a function?