1

I'm basically looking for a javascript library that accepts an arbitrary string which may be valid javascript and returns a "cleaned up" version based on javascript indention rules. It would be nice if the library also did css and html.

Barring that, if someone has an interesting idea for doing it from javascript I'd love to hear it.

Jeffrey Basurto
  • 1,425
  • 1
  • 10
  • 24
  • 4
    [jsbeautifier](http://jsbeautifier.org/) – Raynos Sep 10 '11 at 21:37
  • You might find the answers in this thread usefull: http://stackoverflow.com/questions/1045241/what-is-a-good-stand-alone-javascript-formatter-for-fixing-missing-semicolons – ChrisR Sep 10 '11 at 21:38
  • 1
    *related* (duplicate?): [JavaScript beautifier](http://stackoverflow.com/questions/18985/javascript-beautifier). It doesn't do HTML and CSS though. – Felix Kling Sep 10 '11 at 21:38
  • 1
    http://jsfiddle.net/ has an identation function as well, for both js, css and html. – yoda Sep 10 '11 at 21:41
  • also, **JSLint** and **JSHint** – c69 Sep 22 '11 at 20:58

1 Answers1

0

you can use https://beautifier.io/ .

But you can also use node-beautifier in node js :P

Thibaud
  • 1,059
  • 4
  • 14
  • 27