Skip to content

Instantly share code, notes, and snippets.

@en0
Created February 8, 2018 22:47
Show Gist options
  • Save en0/7ae8740243612e519d63c2a3533a4fc8 to your computer and use it in GitHub Desktop.
Save en0/7ae8740243612e519d63c2a3533a4fc8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
const fs = require("fs");
const path = process.argv.pop();
const code = fs.readFileSync(path, "utf8");
const lines = code.split("\n");
const ret = JSON.stringify(lines, null, 2);
process.stdout.write(ret);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment