node and express send json formatted
try to set the “secret” property json spaces on the Node app. app.set(‘json spaces’, 2) This statement above will produce indentation on json content.
try to set the “secret” property json spaces on the Node app. app.set(‘json spaces’, 2) This statement above will produce indentation on json content.
Provided you know the maximum length to be no more than 20 characters: printf “%-20s %s\n”, value_name, value If you want to make it more dynamic, something like this should work nicely: longest_key = data_hash.keys.max_by(&:length) data_hash.each do |key, value| printf “%-#{longest_key.length}s %s\n”, key, value end