Is there a reliable way to JSON.stringify a JavaScript object that guarantees that the ceated JSON string is the same across all browsers, node.js and so on, given that the Java
You may find bencode suitable for your needs. It's cross-platform, and the encoding is guaranteed to be the same from every implementation.
The downside is it doesn't support nulls or booleans. But that may be okay for you if you do something like transforming e.g., bools -> 0|1
and nulls -> "null"
before encoding.