In my package.json file, I have so many commands in "scripts" like the code below.
"scripts" {
"script1": "command example",
"script2": "command example",
"script3": "command example",
"script4": "command example",
"script5": "command example",
"script6": "command example",
"script7": "command example",
...
}
Is there any way to move those commands to another file?
For instance, I'm thinking about moving them to a file like bin/commands.js.
This is a common problem, having your package.json get bloated from too many scripts. There is a pretty good solution built by Kent Dodds, called NPS (npm-package-scripts). Unfortunately there are not many solutions for this problem.
PRO: you define the script in a js file so you have more flexibility, reduces clutter in your package.json, good community support.
CON: Not many just a different command (nps vs npm)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With