function to format file using jsbeautify