

Give npm scripts a chance - TheAceOfHearts
https://blog.cesarandreu.com/posts/give_npm_scripts_a_chance

======
natch
bash (or whatever shell you prefer) aliases and functions do all this, but
with way less typing at time of use. What am I missing?

~~~
syntheticcdo
You can commit package.json to git and it will be easier to share with others
on your team in a heterogeneous environment.

~~~
smt88
Still not sure I get it.

The benefit is: distribute via npm

The cost is: (lots of) extra typing for common commands

When I'm in my terminal (messing with Docker, changing permissions, running
scripts, etc.), I run a lot of aliased commands, so the cost is much higher
than the benefit for me.

Distribution via npm isn't that much better than committing a bash script to a
git repo and having everyone on the team add it to .bashrc (or whatever their
equivalent is). npm is just an extra layer for something that bash supports
natively.

~~~
TheAceOfHearts
Using package.json is simpler when you're working on multiple projects.

It also means that if you decide to contribute to a random project, you can
simply run "npm test" to make sure your changes are valid. No need to screw
around installing mocha or karma or whatever test framework the project is
using.

You can safely assume that everyone that's using node will have npm, so it
makes sense to keep tasks contained in npm.

