Skip to content

Instantly share code, notes, and snippets.

@bwindels
Created April 27, 2021 15:42
Show Gist options
  • Select an option

  • Save bwindels/82ad2668bf8c05a3ab4f7a48cb2b257e to your computer and use it in GitHub Desktop.

Select an option

Save bwindels/82ad2668bf8c05a3ab4f7a48cb2b257e to your computer and use it in GitHub Desktop.
#!/bin/node
const fs = require("fs");
const filename = process.argv[2];
const str = fs.readFileSync(filename, {encoding: "utf8"});
const json = JSON.parse(str);
fs.writeFileSync(filename, json, {encoding: "utf8"});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment