Query: javascript::beautifier
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
JavaScript::Beautifier(3pm) User Contributed Perl Documentation JavaScript::Beautifier(3pm)NAMEJavaScript::Beautifier - Beautify Javascript (beautifier for javascript)SYNOPSISuse JavaScript::Beautifier qw/js_beautify/; my $pretty_js = js_beautify( $js_source_code, { indent_size => 4, indent_character => ' ', } );DESCRIPTIONThis module is mostly a Perl-rewrite of <http://github.com/einars/js-beautify/tree/master/beautify.js> You can check it through <http://jsbeautifier.org/>FUNCTIONSjs_beautify( $js_source_code, $opts ); beautify javascript. options indent_size indent_character if you prefer Tab than Space, try: { indent_size => 1, indent_character => " ", } preserve_newlines default is 1 my $in = "var a=dont_preserve_newlines"; my $out = "var a = dont_preserve_newlines"; my $js = js_beautify( $in, { preserve_newlines => 0 } ); # $out eq $js $in = "var a=do_preserve_newlines"; $out = "var a = do_preserve_newlines"; $js = js_beautify( $in, { preserve_newlines => 1 } ); # $out eq $js space_after_anon_function default is 0AUTHORFayland Lam, "<fayland at gmail.com>" COPYRIGHT & LICENSE Copyright 2008 Fayland Lam, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2009-12-30 JavaScript::Beautifier(3pm)
Similar Topics in the Unix Linux Community |
---|
clear complex javascript code |
Doubt in Perl Variable declaration |
Javascript PAC file and variables |
Path to javascript source code at local browsing |
JavaScript code - UNIX grep? |