Support for code formatting

Is there any way i can auto format files like js, json etc. initially while opening the file.

To be more precise. I need something like a JSON formatter. As of now only syntax highlighting works

No, this is outside of the scope of the project.