This one will be quick and probably a lot of you know about it but I noticed that this can really cause problems especially when your package.json grows and your environments are called production and preproduction or prod and preprod.
First a question
Find a bug in this package.json.
Have you spot it? Let’s say we want to release production.
So yes. It first invoke preprod-release and then prod-release. Maybe for you it does not sound strange but for me it’s pretty sick. npm has some sugar in it like npm start, npm stop, npm restart, npm test but I get that. People wanted to simplify their life with these.
I find these pre and post prefixes to be over-engineering. So what problem do they really solve?
The thing that want to be achived is simplification of such constructs.
But is this a bad code? I don't think it is. It is more composable than pre and post prefixes. With this approach you can have more scripts invoked in between.
It also does not put restriction on names of your scripts.
Ok here is the last example…
If you want to read more about this particular npm feature you can do it on official npm documentation .