HU
Huzaifa-Asif/Postman-to-K6
This repository contains scripts for converting Postman collections to K6 scripts.
Postman to K6
This repository contains scripts for converting Postman collections to K6 scripts.
Installation
Global Installation
-
Install Node.js and npm if they are not already on your machine.
sudo apt install nodejs npm
-
Install the postman-to-k6 package globally.
npm install -g @apideck/postman-to-k6
Local Installation
-
Navigate to your project directory.
cd /path/to/your/project -
Install the postman-to-k6 package locally.
npm install @apideck/postman-to-k6
Usage
Conversion with Collection Only
- Convert your Postman collection to a K6 script.
npx postman-to-k6 YOUR_POSTMAN_COLLECTION.json -o YOUR_K6_SCRIPT.js
Conversion with Collection and Environment Variables
-
Convert your Postman collection to a K6 script, including environment variables.
npx postman-to-k6 YOUR_POSTMAN_COLLECTION.json -e YOUR_ENV_FILE.json -o YOUR_K6_SCRIPT.js
-
Run your K6 script.
k6 run YOUR_K6_SCRIPT.js
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Official Documentation
For more information, please refer to the official documentation.
On this page
Languages
JavaScript100.0%
Contributors
GNU General Public License v3.0
Created December 8, 2023
Updated May 19, 2025