sorry if I didn’t get your question correctly. to work with timestamps in node js use moment.js
here is how you can show the current date in moment js.
You can’t format JSON for the client. pretty-format is meant to format console output, and if that’s what you’re trying to accomplish, then you simply call the function:
var prettyFormat = require('pretty-format');
console.log(prettyFormat(somJSON));
If you use response.json instead of response.end you’ll send a JSON formatted string. You can write a front-end web app that consumes your API, which you can use to display the data however you want for anyone visiting your app. Other than that, there’s nothing you can do. If I make a request to your server, you cannot format the response for me.