Skip to content

Instantly share code, notes, and snippets.

@mohiji
Created April 23, 2014 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohiji/11235244 to your computer and use it in GitHub Desktop.
Save mohiji/11235244 to your computer and use it in GitHub Desktop.
Removes all non-important whitespace from a JSON file.
(require 'st-json)
(defun squish-json-file (filename)
(let ((parsed-json (with-open-file (stream filename)
(st-json:read-json stream))))
(with-open-file (stream (concatenate 'string filename ".squished")
:direction :output
:if-exists :supersede)
(st-json:write-json parsed-json stream))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment