0.1.4 • Published 11 years ago

jcompressor v0.1.4

Weekly downloads
43
License
-
Repository
github
Last release
11 years ago

jcompressor

jcompressor is a Closure Compliler-based JavaScript compressor (node package) that compresses all .js files in the current directory (JRE, Node.js and npm is required).

Usage

Install jcompressor

npm install -g jcompressor

Compress

  1. Direct to the project folder where you would like to compress
  2. Drop into the Node REPL by executing

    node
  3. Executing the line below with optimal parameters for .compress() function (see #API)

    require('jcompressor').compress();
  4. Check it out :)

API

compress() takes three optional parameters in order:

  1. prefix: String, the prefix string added to the compressed file. '' (empty string) by default;
  2. suffix: String, the suffix string added to the compressed file. '-min' by default;
  3. replaceOriginal: Boolean, the original files are deleted if true. true by default;

Take /PATH/TO/example.js as an example:

require('jcompressor').compress();
//  /PATH/TO/example-min.js
    
require('jcompressor').compress('cc-', null, false);
//  /PATH/TO/cc-example-min.js, /PATH/TO/example.js (Still survives!)
    
require('jcompressor').compress('', '_v1');
//  /PATH/TO/example_v1.js
0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago