First times automating NPM and using scripts in package.json can be confusing. Usual syntax shown is
npm start and when you create your own script with some other name it doesn't work. Or worse, it does something totally different.
Worry not. NPM scripts are used to use with command
npm run-script <script-name>. Confusing is that there is some commands which are aliases for scripts:
installruns prepublish, publish, preinstall & install scripts
testruns pretest, test & posttest
stopruns prestop, stop & poststop
startruns prestart, start & poststart
restartruns prerestart, restart, postrestart
Mentioned scripts can be overriden. Which I propose if it works with your apps life cycle.
As noticed, it's much safer still to run
npm run-script <script-name> to use the script. You can't run custom script straight with
Notice that if you run script, also pre and post scripts are run if exist. Pre- and postscripts are named with your script name with prefix. Example if your script name is
postdiamond are run.