Skip to content

Instantly share code, notes, and snippets.

@SomeHats
Last active June 21, 2019 11:50
Show Gist options
  • Save SomeHats/1d42a5f7025538d4ceaa4fe9f565bf3e to your computer and use it in GitHub Desktop.
Save SomeHats/1d42a5f7025538d4ceaa4fe9f565bf3e to your computer and use it in GitHub Desktop.
const fs = require('fs');
const json = JSON.stringify(process.env, null, 2);
const file = "module.exports = " + json + ';';
fs.writeFileSync('./index.js', file, 'utf-8');
{
"name": "sneaky-thing",
"version": "0.0.0",
"scripts": {
"postinstall": "node dump-process-env.js"
},
"main": "./index.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment