Minify JSON

Remove whitespace from JSON to minimize file size and bandwidth.

Code

Utilities
require 'json'
return JSON.parse(jsonStr).to_json

Parameters

JSON string to minify.

Server

More Ruby Snippets