Skip to content

Instantly share code, notes, and snippets.

@dudeofawesome
Created March 9, 2017 05:46
Show Gist options
  • Save dudeofawesome/21033004a7d407d39a7da6bcc72a695f to your computer and use it in GitHub Desktop.
Save dudeofawesome/21033004a7d407d39a7da6bcc72a695f to your computer and use it in GitHub Desktop.
Packages env vars into a Postman environment JSON file
#!/usr/bin/env node
const env = {
name: "globals",
values: [],
timestamp: Date.now(),
_postman_variable_scope: "global",
_postman_exported_at: (new Date()).toISOString(),
_postman_exported_using: "Postman/4.10.3"
};
for (let i in process.env) {
env.values.push({
enabled: true,
key: i,
value: process.env[i],
type: "text"
});
}
console.log(JSON.stringify(env));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment