Method: YUICompressor.compress_js

Defined in:
lib/yuicompressor.rb

.compress_js(stream_or_string, options = {}, &block) ⇒ Object

Compress the given JavaScript stream_or_string using the given options. Options should be a Hash with any of the following keys:

:line_break

The maximum number of characters that may appear in a single line of compressed code. Defaults to no maximum length. If set to 0 each line will be the minimum length possible.

:munge

Should be true if the compressor should shorten local variable names when possible. Defaults to false.

:preserve_semicolons

Should be true if the compressor should preserve all semicolons in the code. Defaults to false.

:optimize

Should be true if the compressor should enable all micro optimizations. Defaults to true.

:charset

Charset. Default is utf8.



40
41
42
# File 'lib/yuicompressor.rb', line 40

def compress_js(stream_or_string, options={}, &block)
  compress(stream_or_string, options.merge(:type => 'js'), &block)
end