Reputation: 5578
I'm using node-orm2 to persist a model to a mysql db column. It works great, except I want the written json pretty printed, so I can easily read it when I view the DB.
Is this possible?
Upvotes: 1
Views: 76
Reputation: 99
you can use JSON stringify with params:
var obj = {manu: true, gili: "abc"}
var str = JSON.stringify(obj, null, 4); // spacing = 4
Upvotes: 1