npm scrips as your build tool

Published 2017-04-29

The course introduces the topic of using npm scripts as a build tool. It starts simple and then continue to build a small website as we introduce new topics.

By the end of the course, you’ll know how to get started and what tools and techniques are needed for you to create your own set of build scripts.

Topics:

  1. Create a basic package.json file
  2. Run the basic npm scripts
  3. Create a custom npm script
  4. Run npm scripts in series
  5. Run npm scripts in parallel
  6. Use a shorthand syntax for running multiple npm scripts with npm-run-all
  7. Run a set of similar npm scripts with a wildcard
  8. Use pre and post npm script lifecycle hooks with test coverage
  9. Pass arguments to npm scripts via --
  10. Pipe data from one npm script to another with build-site scripts
  11. Run npm scripts when files change with onchange
  12. Use package.json variables in npm scripts
  13. Use custom config settings in your npm scripts
  14. Run npm scripts with git hooks using husky
  15. Change the level of console output when running npm scripts
  16. Make npm scripts cross-environment friendly with cross-env, rimraf, opn-cli, cross-var
  17. List available npm scripts and support tab completion with ntl
  18. Add comments to your npm scripts
  19. Pull out npm scripts into another file with p-s
  20. Create a bash script to replace a complex npm script
  21. Create a node script to replace a complex npm script

Links

egghead course - How to Use npm Scripts as Your Build Tool