Created
April 22, 2021 19:06
-
-
Save peterbe/3195822bd4f0f85f5ed4f104f96fbf2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const all = JSON.parse(fs.readFileSync("files/en-us/_wikihistory.json")); | |
const sorted = Object.fromEntries( | |
Object.keys(all) | |
.sort() | |
.map((key) => { | |
return [key, all[key]]; | |
}) | |
); | |
fs.writeFileSync( | |
"/tmp/_wikihistory.json", | |
JSON.stringify(sorted, null, 2) + "\n", | |
"utf-8" | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment