This site has been acquired by Toptal.com.
(Attention! API endpoint has changed)

JavaScript Minifier

Online JavaScript Minifier/Compressor. Provides an API. Simple and Fast.

Ruby

Thanks toJeremy Cron for contributing this example.

require "rest_client"

task :minify do
  js_file = "public/scripts/ready.js"
  js_min_file = "public/scripts/ready.min.js"
  response = RestClient.post "https://www.toptal.com/developers/javascript-minifier/raw", {:input => File.open(js_file).read}
  File.open(js_min_file, "w").write(response)
end

Click on the language of your choice to see an example: