JSON.stringify
is probably the closest you are going to get from native libraries. It doesn’t work well with objects, but you could define your own code to work around that. I searched for libraries that provide this functionality but didn’t find anything.