node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »


ShrinkApp is a build utility for HTML5 applications (preferably single page applications). The goal is to produce a production ready HTML5 application with minified css and js files along with the relevant HTML markup changes.


  • Parses HTML files to find link and script tags using htmlparser2 (
  • Compiles less files using less compiler (
  • Compiles sass files
  • Shrinks css files using yuicompressor (
  • Shrinks javascript files using UglifyJS (
  • Shrinks HTML files
  • Shrinks the content of style and script tags
  • Modifies HTML tags pointing to less/css and/or javascript files to point to the minified ones instead
  • Generates well formatted HTML code using js-beautify (
  • Produces a build directory containing the shrunk application
  • Displays shrinkapp analysis

Tested On

  • AngularJS's seed application (
  • Bootstrap template from
  • Classic template from
  • Responsive template from
  • Bootstrap template from
  • HTML5 Boilerplate template from Version: 4.2.0
  • Mobile Boilerplate template from Version: 4.1
  • Twitter Bootstrap template from


First make sure you have installed the latest version of node.js (You may need to restart your computer after this step).

From NPM for use as a command line app:

On Linux:

    npm install shrinkapp@linux -g

On Windows:

    npm install shrinkapp@windows -g

From NPM for programmatic use:

On Linux:

    npm install shrinkapp@linux

On Windows:

    npm install shrinkapp@windows

From Git:

    git clone git://
    cd ShrinkApp
    npm link .


    shrinkapp [source directory] [options]

The available options are:

  -c, --create-app [app-name]
        Create a default app.json under the specified source directory.
  -f, --force
        overwrite files.
  -a, --analysis
        Display analysis data after shrink.
  -v, --version
        Display package version.
  -h, --help
        Display help.