npm run-script <custom_script_name>
or
npm run <custom_script_name>
In your example, you would want to run npm run-script script1
or npm run script1
.
See https://docs.npmjs.com/cli/run-script
Node also allows you to run custom scripts for certain lifecycle events, like after npm install
is run. These can be found here.
For example:
"scripts": {
"postinstall": "electron-rebuild",
},
This would run electron-rebuild
after a npm install
command.