Saving tables to file with JSON - no newlines?

I’ve been using saveTable and loadTable to save/restore table data to flatfiles. It works fine, but when viewing the flatfiles directly, the entire JSON description is all on one line, instead of being nicely formatted. Is there any way to write a table to file with json.encode() so the file presents cleanly in a text editor?