pretty-print JSON in a buffer