var data = {
name: "himanshu",
github: "himanshurajora"
}
var strData = JSON.stringify(data)
// json stringify by default gives us double quotes
// you can setup the same format as json itself
var strData = JSON.stringify(data, null, 4)
Use JSON5.stringify
JSON5 is a superset of JSON that allows ES5 syntax, including unquoted property keys. The JSON5 reference implementation (json5 npm package) provides a JSON5 object that has the same methods with the same args and semantics as the built-in JSON object.
It is highly likely that the service you are using is using this library.