-3

This will without a doubt be a duplicate, but I have no idea what else to call it.

A friend of mine is trying to learn Javascript. He accidentally saved the "compressed" (all whitespace removed) version as the version he has, and wants me to help format it again. He's emailed me a massive .js file and... I'm not sure what to do.

I don't want to install (no doubt Eclipse has one) a Javascript plugin for Eclipse just to right click and format once. Is there a tool for this? A parser that'll build an AST then format that AST?

user229044
  • 232,980
  • 40
  • 330
  • 338
Alec Teal
  • 5,770
  • 3
  • 23
  • 50
  • 2
    http://jsbeautifier.org/ – adeneo Mar 16 '14 at 15:55
  • 2
    Tell your friend to use source control. – Oliver Charlesworth Mar 16 '14 at 15:55
  • @OliCharlesworth have you ever had a friend who you try and distance yourself from in a way they can't call you out on? He's an idiot and he loves notepad++ and browsers, and windows... I don't want to invest the time to teach him version control. (SVN FTW, Monotonically increasing revision numbers are their own reward!) – Alec Teal Mar 16 '14 at 15:57
  • 1
    I personally use notepad++ and browsers and windows and also source control. Try not to copy yourself to your friend, instead help him be himself. – sabithpocker Mar 16 '14 at 15:59
  • @meagar how did you post that? Surely all your bandwidth was being used by creating an entire clone of your distributed repository? *wink* – Alec Teal Mar 16 '14 at 15:59
  • 2
    @AlecTeal So you know, you sound like a child. Calling somebody an "idiot" for their editor choice/language choice is petulant. I personally think the most egregious thing listed so far isn't Windows or Notepad++ or "browsers" or JavaScript, but your suggestion that somebody should use SVN. I'm not going to call you an "idiot" for it, but SVN is objectively the *wrong* choice for version control. – user229044 Mar 16 '14 at 16:01

1 Answers1

1

Tool to Unminify / Decompress JavaScript

Apparently JS beautifier will do the trick sometimes.

There's a plethora of others on there.

Community
  • 1
  • 1
tywalker
  • 78
  • 6