I want to know some process information ran on the VPS with PM2. But, with the JSON string return by PM2, we can't run JSON.parse()
because the JSON is broken.
An example of what PM2 returns:
'{data: 0, informations: "hello", name: "test"}'
But, if you know how the JSON.parse work, you know the problem. We can't parse this string.
Do you have idea to resolve this problem with another function ?
Thanks in advance.
Here is a solution for your specific non-json format. The trick is to make sure to have double quotes around keys...