I have a JSON file generated from PhantomJS, and it appears as follows:
{
"startedDateTime": "2015-04-27T12:48:47.107Z",
"time": 281,
"request": {
"method": "GET",
"url": "http://www.example.com/DE/de/shop/welcome.html;jsessionid=FEA0923A36729B5D6274597B4B59365E.appserver06t1",
"httpVersion": "HTTP/1.1",
"cookies": [],
"headers": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.8 Safari/534.34"
},.....
My goal is to compress this JSON data into a single line using JavaScript like so:
{"startedDateTime": "2015-04-27T12:48:47.107Z","time": 281,"request": {"method": "GET","url": "http://www...........
How can I achieve this compression?