NProgress.start() — shows the progress bar

NProgress.set(0.4) — sets a percentage — increments by a little

NProgress.done() — completes the progress

NProgress.promise(promise) — Progress completes when all promises are resolved - additive (try clicking the button multiple times)
Demo uses promises that are resolved randomly between 0 and 3 seconds (doesn't work in IE 11 without a polyfill)

Perfect for Ajax requests (jQuery, Axios, Turbolinks, Pjax) and other apps which need to display progress/spinners.

Github Page