Packing/Unpacking Javascript from DOS

Here's one way to pack and unpack Javascript from the Windows' command line. For this we use PhantomJS and Dean Edwards' Javascript Compressor version 3.0.

  1. Download PhantomJS from here
  2. Download the JSPacker.js file from the Tools page
  3. Put everything in a folder or on your desktop then in DOS type the following:

    C:\> phantomjs jspacker.js pack in.txt out.txt
    -or-
    C:\> phantomjs jspacker.js unpack in.txt out.txt

Posted on: 02/06/2016