JSON canonicalize function. Creates crypto safe predictable canocalization of JSON as defined by draft-rundgren-json-canonicalization-scheme
JSON.canonicalize = require('canonicalize');
const json = {
"1": {"f": {"f": "hi","F": 5} ,"\n": 56.0},
"10": { },
"": "empty",
"a": { },
"111": [ {"e": "yes","E": "no" } ],
"A": { }
}
console.log(JSON.canonicalize(json));
npm install canonicalize --save
npm test