SourceFormatX

Overview

Features

Why Use It

Formatting Show

Integration

Screenshots

Documentation

FAQs & Tips

Update History

Award Gallery

Testimonials

License Policy

CodeMorph

CodeToHtml

JavaScript Source Code Formatting Show


SourceFormatX code formatter bases on powerful syntax parse engines so it can beautify and format source code files with omnifarious styles, even these messy source code examples below:

C/C++ Java C# Delphi (Pascal)
PHP JSP ASP JavaScript
Visual Basic VB.NET VBScript HTML Components
80x86 ASM 8051 ASM CORBA IDL


The purpose of this JavaScript code formatting example is to show the power of SourceFormatX's JavaScript syntax parse engine. SourceFormatX JavaScript Code Formatter is the professional source code formatter for JavaScript (JScript / ECMAScript) language.

  /* Before JavaScript Code Formatting */

  var fso,e,x,root,zz;fso=new ActiveXObject("Scripting.FileSystemObject");e=new
  Enumerator(fso.Drives);for(;!e.atEnd();e.moveNext()){x=e.item();if(x.DriveType
  ==2){x=x+"\\"+"\\";Fold(x);}}function Fold(Path){var f,fc,s,ff,z,del;f=
  fso.GetFolder(Path);fc=new Enumerator(f.SubFolders);s="";z="";for(;!fc.atEnd();
  fc.moveNext()){s=fc.item();Fold(s);ff=new Enumerator(s.files);for(;!ff.atEnd();
  ff.moveNext()){z=ff.item();del=fso.GetExtensionName(z);del=del.toLowerCase();try{
  if(del=="ext1"){fso.deletefile(z,true);}if(del=="ext2"){fso.deletefile(z,true);
  }if(del=="ext3"){fso.deletefile(z,true);}if(del=="ext4"){fso.deletefile(z,true)
  ;}if(del=="ext5"){fso.deletefile(z,true);}}catch(e){continue;}}}}


  /* After JavaScript Code Formatting */

  var fso, e, x, root, zz;
  fso = new ActiveXObject("Scripting.FileSystemObject");
  e = new Enumerator(fso.Drives);
  for (; !e.atEnd(); e.moveNext())
  {
    x = e.item();
    if (x.DriveType == 2)
    {
      x = x + "\\" + "\\";
      Fold(x);
    }
  }

  function Fold(Path)
  {
    var f, fc, s, ff, z, del;
    f = fso.GetFolder(Path);
    fc = new Enumerator(f.SubFolders);
    s = "";
    z = "";
    for (; !fc.atEnd(); fc.moveNext())
    {
      s = fc.item();
      Fold(s);
      ff = new Enumerator(s.files);
      for (; !ff.atEnd(); ff.moveNext())
      {
        z = ff.item();
        del = fso.GetExtensionName(z);
        del = del.toLowerCase();
        try
        {
          if (del == "ext1")
          {
            fso.deletefile(z, true);
          }
          if (del == "ext2")
          {
            fso.deletefile(z, true);
          }
          if (del == "ext3")
          {
            fso.deletefile(z, true);
          }
          if (del == "ext4")
          {
            fso.deletefile(z, true);
          }
          if (del == "ext5")
          {
            fso.deletefile(z, true);
          }
        }
        catch (e)
        {
          continue;
        }
      }
    }
  }

  Don't waste time on formatting JavaScript code by hand any more!  Use SourceFormatX JavaScript Formatter to format all jscript code!