Pros and Cons of npm scripts
vs Gulp
npm scripts
vs Gulpnpm scripts
npm scripts
are low-level and leverage the actual library you want to use (example: "lint": "eslint ./"
)package.json
is a central place to see what scripts are available (also npm run
will list all scripts)"complex-script": "babel-node tools/complex-script.js"
)npm scripts
are more powerful than one might first think (pre/post hooks, passing arguments, config variables, chaining, piping, etc...)npm scripts
npm scripts
npm-run-all
: A CLI tool to run multiple npm-scripts in parallel or sequential.rimraf
: A deep deletion module for node (like rm -rf
)onchange
: Use glob patterns to watch file sets and run a command when anything is added, changed or deleted.npm scripts
only, keep using Gulp, or have a mixture of the two?npm scripts
and Gulp, how do we decide when to use what? Do we start with an assumption of npm scripts
until a certain complexity threshold is met? Do we only use npm scripts
for new projects and then split out to tools/script-file.js
when the complexity gets high? (See react-slingshot for an example)npm scripts
if we find we keep updating them?