Created
March 9, 2017 05:46
-
-
Save dudeofawesome/21033004a7d407d39a7da6bcc72a695f to your computer and use it in GitHub Desktop.
Packages env vars into a Postman environment JSON file
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
#!/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