Is it possible to indent JavaScript code in Notepad++?

JavascriptNotepad++IndentationText Indent

Javascript Problem Overview


I have some JavaScript code that is written in one line (no carriage returns), it's completely unreadable...

With Notepad++, I tried to replace these characters ({, }, ;) by themselves plus a carriage return, but it still isn't very handy...

Is there a way to do this correctly in Notepad++?

Javascript Solutions


Solution 1 - Javascript

JSTool is the best for stability.

Steps:

  1. Select menu Plugins>Plugin Manager>Show Plugin Manager
  2. Check to JSTool checkbox > Install > Restart Notepad++
  3. Open js file > Plugins > JSTool > JSFormat
    screenshot

Reference:

Solution 2 - Javascript

I think you want a code beautifier, this one looks quick and easy: http://jsbeautifier.org/

Solution 3 - Javascript

Try the notepad++ plugin JSMinNpp(Changed name to JSTool since 1.15)

http://www.sunjw.us/jsminnpp/

Solution 4 - Javascript

Use jsbeautifier instead of trying to do it manually.

Solution 5 - Javascript

Could you use online services like this ?

Update: (as per request)

Google chrome will do this also http://cristian-radulescu.ro/article/pretty-print-javascript-with-google-chrome.html

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGianT971View Question on Stackoverflow
Solution 1 - JavascriptQuang VinhView Answer on Stackoverflow
Solution 2 - JavascriptRyan DohertyView Answer on Stackoverflow
Solution 3 - JavascriptSun JunwenView Answer on Stackoverflow
Solution 4 - Javascriptuser1106925View Answer on Stackoverflow
Solution 5 - JavascriptSam GreenhalghView Answer on Stackoverflow