Giter VIP home page Giter VIP logo

postman-environment-generator's Introduction

postman-environment-generator

An NodeJS app that creates a Postman environment for all the variable names in your Postman collection.

Introduction

For more information on Postman, Postman-collections and Postman-environments, check out Postman

This app was born to serve the following, specific use case:

Say that you import a huge collection in a workspace that has tonnes of environment variables embedded inside out it (In the form of {{variable}}). Now you need an environment that contains all those variables but, manually creating them would be cumbersome. Hence, you use this app, which takes a JSON file as input and using the Postman API, creates an environment for you in the given workspace, containing all those variables.

Requirements

  1. NodeJS version 10.15.0+
  2. npm version 6.4.1+
  3. Postman Desktop App version 7.0.0+
  4. Postman API Key (Steps to get that are here)

Usage

  1. Clone this into your local folder and navigate to it.
  2. Run npm install
  3. Export the collection JSON from the Postman app (Steps to do that are here). The file encoding must be utf-8.
  4. Run node index.js <absolute-path-to-collection-file> <name-that-environment-should-get> <postman-api-key> <workspace-id>

The workspace-id is an optional parameter. Not giving the workspace Id will add the environment to your default workspace. To get the workspace-id, follow these steps:

  1. Log into the postman app
  2. Select any collection
  3. Click on the right arrow beside the collection name
  4. Click on 'View in Web'
  5. The opened browser window contains url of the form: https://postman.co/collections/xyz-uuid?version=latest&workspace=uuid
  6. Copy the workspace Id.

Example

Running:

node index.js ~/Downloads/collections/my-collection.json ImportedCollection 74a2bdd31eeb457a88c9a3342c7c8f81 404891cb-a247-4508-81dc-38f745118221

Will create an environment called 'ImportedCollection' with all environment variables present in the collection file located at ~/Downloads/collections/my-collection.json, in the workspace with the id 404891cb-a247-4508-81dc-38f745118221.

postman-environment-generator's People

Contributors

cazaimi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.