title: Dynamically change JSON spacing with Express.js
body: <p>I know you can configure Express to output either pretty JSON (<code>app.set("json spaces", 2)</code>) or minified JSON (<code>app.set("json spaces", 0)</code>), but is there a way to override this global setting on a particular response? </p>
  
  <p>For example, if I set <code>json spaces</code> to <code>0</code>, I could pretty print doing something like:</p>
  
  <pre><code>app.get("/foo", function(req,res) {
     res.json({"a":"b"}, 2);
  });
  </code></pre>
  
  <p>Thanks!</p>