A new release of a typical, non-trivial JavaScript project needs to run unit tests, concatenate all source files into one file and minify the result. Some of them also use code generators, coding style validators or other build time tools.
This post explains how to use Grunt.js to build JavaScript library. Grunt.js requires Node.js and npm to run, so first sections explain what those are, how to install them and how to use them. You can feel free to skip those sections if you have already worked with npm. The fourth and fifth sections cover how to configure Grunt and a number of typical Grunt tasks.