{"_id":"@aegrey/postman-to-k6","_rev":"1-7d658195b28d976c4228d8eafefbc1b1","name":"@aegrey/postman-to-k6","dist-tags":{"latest":"1.9.1"},"versions":{"1.9.0":{"name":"@aegrey/postman-to-k6","version":"1.9.0","description":"Convert a Postman collection to k6 JavaScript","keywords":["k6","postman","loadtest","load-test","load-testing","server-load","performance"],"homepage":"https://github.com/aegrey/postman-to-k6#readme","bugs":{"url":"https://github.com/aegrey/postman-to-k6/issues"},"repository":{"type":"git","url":"git+https://github.com/aegrey/postman-to-k6.git"},"license":"Apache-2.0","author":"","main":"bin/postman-to-k6.js","bin":{"postman-to-k6":"bin/postman-to-k6.js"},"directories":{"bin":"bin","lib":"lib"},"scripts":{"bundle":"node scripts/bundle.js","lint:fix":"yarn lint --fix","lint":"eslint .","format":"prettier -c ./lib/**/*.js ./test/**/*.js","format:fix":"yarn format --write","postinstall":"node scripts/bundle.js","test":"npm-run-all test-unit test-com test-int","test-com":"cross-env NODE_PATH=lib:test ava test/com/**/*.js","test-hoc":"cross-env NODE_PATH=lib:test ava","test-int":"cross-env NODE_PATH=lib:test ava test/int/*.js","test-unit":"cross-env NODE_PATH=lib:test ava test/unit/**/*.js","prepare":"husky install","release":"yarn format && yarn lint && yarn bundle && np --branch main"},"dependencies":{"ajv":"^6.12.6","aws4":"^1.11.0","browserify":"^16.5.2","chai":"^4.3.4","cheerio":"1.0.0-rc.6","commander":"^2.20.3","crypto-js":"^4.2.0","eslint":"^7.32.0","eslint-config-prettier":"^6.11.0","fs-extra":"^8.1.0","lodash":"^4.17.21","oauth-1.0a":"^2.2.5","papaparse":"^5.3.1","pkginfo":"^0.4.1","postman-collection":"^4.3.0","postman-collection-transformer":"^4.1.8","prettier":"^1.19.1","spo-gpo":"^1.0.0","strip-json-comments":"^3.1.1","urijs":"^1.19.11","uuid":"^3.3.2","verror":"^1.10.0","xml2js":"^0.5.0"},"devDependencies":{"@babel/plugin-transform-runtime":"^7.15.0","@babel/preset-env":"^7.15.0","@babel/register":"^7.15.3","@babel/runtime":"^7.15.3","ava":"^2.4.0","cross-env":"^6.0.3","husky":"^7.0.4","mock-require":"^3.0.3","np":"^7.6.2","npm-run-all":"^4.1.5","sinon":"^7.5.0","snazzy":"^8.0.0","standard":"^14.3.1"},"preferGlobal":true,"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_id":"@aegrey/postman-to-k6@1.9.0","gitHead":"8cebb39b8c6478a53e8652fbd3a0362544da41cb","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Fp8rUBcpriT5kZJaVaEeugfsEA0Kubiu7FbXFuLBZNNZwqVPmKjPs6L/LZp3V1h7cKeJc52BiJG/DVmfLI7zzw==","shasum":"ef3d6a74fde77039e1344846a764abf9f024f5a6","tarball":"https://registry.npmjs.org/@aegrey/postman-to-k6/-/postman-to-k6-1.9.0.tgz","fileCount":68,"unpackedSize":1448397,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHsyhixY0A/bQuB9cop4NfYW+Y38T0cbIPi6hFB7GIzAiBpRyRKwI1edx4bA7JzAUWaUlYYD74MCN8kHNHanpAEVw=="}]},"_npmUser":{"name":"aegrey","email":"annisgrey@gmail.com"},"maintainers":[{"name":"aegrey","email":"annisgrey@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postman-to-k6_1.9.0_1711502903039_0.8499697514834039"},"_hasShrinkwrap":false},"1.9.1":{"name":"@aegrey/postman-to-k6","version":"1.9.1","description":"Convert a Postman collection to k6 JavaScript","keywords":["k6","postman","loadtest","load-test","load-testing","server-load","performance"],"homepage":"https://github.com/aegrey/postman-to-k6#readme","bugs":{"url":"https://github.com/aegrey/postman-to-k6/issues"},"repository":{"type":"git","url":"git+https://github.com/aegrey/postman-to-k6.git"},"license":"Apache-2.0","author":"","main":"bin/postman-to-k6.js","bin":{"postman-to-k6":"bin/postman-to-k6.js"},"directories":{"bin":"bin","lib":"lib"},"scripts":{"bundle":"node scripts/bundle.js","lint:fix":"yarn lint --fix","lint":"eslint .","format":"prettier -c ./lib/**/*.js ./test/**/*.js","format:fix":"yarn format --write","postinstall":"node scripts/bundle.js","test":"npm-run-all test-unit test-com test-int","test-com":"cross-env NODE_PATH=lib:test ava test/com/**/*.js","test-hoc":"cross-env NODE_PATH=lib:test ava","test-int":"cross-env NODE_PATH=lib:test ava test/int/*.js","test-unit":"cross-env NODE_PATH=lib:test ava test/unit/**/*.js","prepare":"husky install","release":"yarn format && yarn lint && yarn bundle && np --branch main"},"dependencies":{"ajv":"^6.12.6","aws4":"^1.11.0","browserify":"^16.5.2","chai":"^4.3.4","cheerio":"1.0.0-rc.6","commander":"^2.20.3","crypto-js":"^4.2.0","eslint":"^7.32.0","eslint-config-prettier":"^6.11.0","fs-extra":"^8.1.0","lodash":"^4.17.21","oauth-1.0a":"^2.2.5","papaparse":"^5.3.1","pkginfo":"^0.4.1","postman-collection":"^4.3.0","postman-collection-transformer":"^4.1.8","prettier":"^1.19.1","spo-gpo":"^1.0.0","strip-json-comments":"^3.1.1","urijs":"^1.19.11","uuid":"^3.3.2","verror":"^1.10.0","xml2js":"^0.5.0"},"devDependencies":{"@babel/plugin-transform-runtime":"^7.15.0","@babel/preset-env":"^7.15.0","@babel/register":"^7.15.3","@babel/runtime":"^7.15.3","ava":"^2.4.0","cross-env":"^6.0.3","husky":"^7.0.4","mock-require":"^3.0.3","np":"^7.6.2","npm-run-all":"^4.1.5","sinon":"^7.5.0","snazzy":"^8.0.0","standard":"^14.3.1"},"preferGlobal":true,"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_id":"@aegrey/postman-to-k6@1.9.1","gitHead":"de69226b258ee4ea6f65ea773abf48f36e30f34f","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-rfJCjp39HAs+DVo7wQ2BZKKruD1hMbd2W6kq8vl63HcXfAagu3C5mruWsqp+iscHFoiavnivtBzkz8ZTqXTMLQ==","shasum":"cb4cde4ff4a1fa5a2b00c028ae37e65f98eba00f","tarball":"https://registry.npmjs.org/@aegrey/postman-to-k6/-/postman-to-k6-1.9.1.tgz","fileCount":68,"unpackedSize":1448600,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6GQ8HJi5tD9RbbdBv8dRKyG2VhKUUzVnP/l0MpZXUqQIhAM/pQoVgwqlGScEkBXYG3Sr8b4/MPPfqxaEEBPmlpTq2"}]},"_npmUser":{"name":"aegrey","email":"annisgrey@gmail.com"},"maintainers":[{"name":"aegrey","email":"annisgrey@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postman-to-k6_1.9.1_1711505324472_0.18298723238189085"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-27T01:28:22.921Z","1.9.0":"2024-03-27T01:28:23.254Z","modified":"2024-03-27T02:08:45.133Z","1.9.1":"2024-03-27T02:08:44.680Z"},"maintainers":[{"name":"aegrey","email":"annisgrey@gmail.com"}],"description":"Convert a Postman collection to k6 JavaScript","homepage":"https://github.com/aegrey/postman-to-k6#readme","keywords":["k6","postman","loadtest","load-test","load-testing","server-load","performance"],"repository":{"type":"git","url":"git+https://github.com/aegrey/postman-to-k6.git"},"bugs":{"url":"https://github.com/aegrey/postman-to-k6/issues"},"license":"Apache-2.0","readme":"# POSTMAN TO k6\n\n\nDue to the lack of feature support in the original library and the apideck fork, I have decided to build this out seperately as I require these features immediately in a project I'm working on. I will focus on **building out new features not currently supported** alongside maintenance     \n   \n\n<sup>This project is a friendly fork of [apideck-libraries/postman-to-k6](https://github.com/apideck-libraries/postman-to-k6) from the original [grafana/postman-to-k6](https://github.com/grafana/postman-to-k6).</sup>   \n\n\n#### Request a New Features\nOpen an issue with your feature request (must me something currently supported in postman) and I'll work on the requests with the most votes in order.   \n   \nAlso feel free to contribute or pass any suggestions along!\n\n\n---\n\nConverts a [Postman collection](https://www.getpostman.com/docs/collections) to a [k6 script](https://docs.k6.io/docs).\n\nThe postman-to-k6 converter utilizes your Postman collection and converts all the Postman requests, including tests,\nvariables, ... to K6 scripts that can be executed by K6 to run performance tests.\n\n![Github badge](https://github.com/aegrey/postman-to-k6/actions/workflows/build-on-tag.yml/badge.svg)\n<a href=\"https://www.npmjs.com/package/@aegrey/postman-to-k6\" alt=\"Latest Stable Version\">![npm](https://img.shields.io/npm/v/@aegrey/postman-to-k6.svg)</a>\n<a href=\"https://www.npmjs.com/package/@aegrey/postman-to-k6\" alt=\"Total Downloads\">![npm](https://img.shields.io/npm/dw/@aegrey/postman-to-k6.svg)</a>\n\n\n## Content\n\n- [Features](#features)\n- [Installation](#installation)\n    - [Local Installation (recommended)](#local-installation-recommended)\n    - [Global Installation](#global-installation)\n- [Usage](#usage)\n- [Video introduction](#video-introduction)\n- [Options](#options)\n    - [Iterations](#iterations)\n    - [Environment Variables](#environment-variables)\n    - [Global Variables](#global-variables)\n    - [CSV Data File](#csv-data-file)\n    - [JSON Data File](#json-data-file)\n    - [K6 Param Options File](#k6-param-options-file)\n    - [K6 Handle Summary as JSON](#k6-handle-summary-as-json)\n    - [K6 Request tag](#k6-request-tag)\n    - [Separate](#separate)\n    - [Skip Pre](#skip-pre)\n    - [Skip Post](#skip-post)\n    - [CLI options file](#cli-options-file)\n- [Examples](#examples)\n- [Unsupported Features](#unsupported-features)\n- [Other similar tools](#other-similar-tools)\n- [Credits](#credits)\n\n## Features\n\n- [x] Pre-request scripts.\n- [x] Test scripts.\n- [x] Variables (at all scopes + dynamic).\n- [x] Data files.\n- [x] Authentication methods (except Hawk).\n- [x] File uploads (experimental).\n- [x] `postman.*` interface ([exceptions below](#unsupported-features)).\n- [x] `pm.*` interface ([exceptions below](#unsupported-features)).\n- [x] Support for\n  Postman [Dynamic Variables](https://learning.postman.com/docs/writing-scripts/script-references/variables-list/)\n  & [ReplaceIn](https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/#using-variables-in-scripts)\n  function.\n- [x] Global variables exposed by Postman: `globals` `environment` `data`\n  `iteration`.\n- [x] `xml2Json` conversion.\n- [x] All [Postman Schema](https://schema.getpostman.com/) versions.\n\n## Installation\n\n### Local Installation (recommended)\n\nWhile possible to install globally, we recommend that you, if possible, add the converter to the `node_modules` of your\ntest project using:\n\n```shell\n$ npm install -D @aegrey/postman-to-k6\n```\n\nor using yarn...\n\n```shell\n$ yarn add @aegrey/postman-to-k6\n```\n\nNote that this will require you to run the converter with `npx @aegrey/postman-to-k6 your-postman-file` or, if you are\nusing an older versions of npm, `./node_modules/.bin/postman-to-k6 your-postman-file`.\n\n### Global Installation\n\n```shell\n$ npm install -g @aegrey/postman-to-k6\n```\n\n## Usage\n\nTo convert an exported collection to a k6 script:\n\n```shell\n$ postman-to-k6 collection.json -o k6-script.js\n```\n\nThen run the script in k6, as usual, using:\n\n```shell\n$ k6 run k6-script.js\n```\n\n## Options\n\n### Iterations\n\nConfigures how many times the script will be executed before completion.\n\n| Flag | Verbose        | Default |\n| ---- | -------------- | ------: |\n| `-i` | `--iterations` |       1 |\n\nExample:\n\n```shell\n$ postman-to-k6 collection.json --iterations 25 -o k6-script.js\n```\n\n### Environment Variables\n\nProvide environment variables from a JSON file.\n\n| Flag | Verbose         | Default |\n| ---- | --------------- | ------- |\n| `-e` | `--environment` | N/A     |\n\nExample:\n\n```shell\n$ postman-to-k6 collection.json --environment environment.json -o k6-script.js\n```\n\n### Global Variables\n\nProvide global variables from a JSON file.\n\n| Flag | Verbose    | Default |\n| ---- | ---------- | ------- |\n| `-g` | `--global` | N/A     |\n\n```shell\n$ postman-to-k6 collection.json --global globals.json -o k6-script.js\n```\n\n### CSV Data File\n\nProvide a data file in the CSV format.\n\n| Flag | Verbose | Default |\n| ---- | ------- | ------- |\n| `-c` | `--csv` | N/A     |\n\n```shell\n$ postman-to-k6 collection.json --csv data.csv -o k6-script.js\n```\n\n### JSON Data File\n\nPass in a data file in the JSON format.\n\n| Flag | Verbose  | Default |\n| ---- | -------- | ------- |\n| `-j` | `--json` | N/A     |\n\n```shell\n$ postman-to-k6 collection.json --json data.json -o k6-script.js\n```\n\n### K6 Param Options File\n\nPass [K6 parameter options](https://k6.io/docs/javascript-api/k6-http/params) as a file in JSON format.\n\n| Flag | Verbose       | Default |\n| ---- | ------------- | ------- |\n|      | `--k6-params` | N/A     |\n\n```shell\n$ postman-to-k6 collection.json --k6-params k6-params.json -o k6-script.js\n```\n\n### K6 Handle Summary as JSON\n\nOutput the [K6 summary](https://k6.io/docs/results-visualization/end-of-test-summary/#handlesummary-callback) as a file\nin JSON format. This will add the K6 `handleSummary(data)` to the generated script, providing the functionality that K6\nwill store the summary output as JSON file locally.\n\n| Flag | Verbose                    | Default |\n| ---- | -------------------------- | ------- |\n|      | `--k6-handle-summary-json` | N/A     |\n\n```shell\n$ postman-to-k6 collection.json --k6-handle-summary-json summary-report.json -o k6-script.js\n```\n\n### K6 Request tag\n\nGenerate [K6 request name tags](https://k6.io/docs/using-k6/http-requests/#http-request-tags) based on available naming\nstrategies:\n\n- none: no automatic generated tags | default\n- `request`: uses the request name as tag (example \"Show all accounts\")\n- `folder-request`: uses Postman folder name and the request name (example: \"Accounts - Show all accounts\")\n\n| Flag | Verbose                | Default |\n| ---- | ---------------------- | ------- |\n|      | `--k6-request-tagging` | N/A     |\n\nExample for `request` strategy\n\n```shell\n$ postman-to-k6 collection.json --k6-request-tagging=request -o k6-script.js\n```\n\nExample for `folder-request` strategy\n\n```shell\n$ postman-to-k6 collection.json --k6-request-tagging=folder-request -o k6-script.js\n```\n\n### Separate\n\nSplit requests into separate files, for easier rearrangement of the logic.\n\n| Flag | Verbose      | Default |\n| ---- | ------------ | ------- |\n| `-s` | `--separate` | false   |\n\n```shell\n$ postman-to-k6 collection.json --separate -o k6-script.js\n```\n\n```shell\n$ postman-to-k6 collection.json -s -o k6-script.js\n```\n\n### Skip Pre\n\nSkips any pre-request scripts during conversion\n\n| Flag | Verbose      | Default |\n| ---- | ------------ | ------- |\n|      | `--skip-pre` | false   |\n\n```shell\n$ postman-to-k6 collection.json --skip-pre -o k6-script.js\n```\n\n### Skip Post\n\nSkips any post-request scripts during conversion\n\n| Flag | Verbose       | Default |\n| ---- | ------------- | ------- |\n|      | `--skip-post` | false   |\n\n```shell\n$ postman-to-k6 collection.json --skip-pre -o k6-script.js\n```\n\n### CLI options file\n\nManage all the CLI options in a separate configuration file and pass them along to the postman-to-k6 command. To make\nthe CLI usage easier, especially in CI/CD implementations.\n\nAll the available CLI options can be used in the config file. By passing the CLI options as parameters, you can\noverwrite the defined CLI options defined in the file.\n\n| Flag | Verbose              | Default |\n| ---- | -------------------- | ------- |\n|      | `--cli-options-file` | false   |\n\n```shell\n$ postman-to-k6 collection.json --cli-options-file cli-config.json\n```\n\nExample of JSON CLI config file\n\n```json\n{\n    \"output\": \"k6-script.js\",\n    \"k6-params\": \"config/k6-params.json\",\n    \"environment\": \"config/envs/team.env.json\",\n    \"separate\": true\n}\n```\n\n## Examples\n\nA collection of Postman examples are located under `example`. To run one of the examples, just run it as you would any\nother command:\n\n```shell\n$ postman-to-k6 example/v2/echo.json -o k6-script.js\n```\n\n## Unsupported Features\n\n- Sending requests from scripts using `pm.sendRequest`.\n- Controlling request execution order using `postman.setNextRequest`.\n- Cookie properties, like `hostOnly`, `session`, and `storeId`.\n- Textual response messages:\n    - `responseCode.name`\n    - `responseCode.detail`\n    - `pm.response.reason`\n    - `pm.response.to.have.status(reason)`\n    - `pm.response.to.not.have.status(reason)`\n- Properties returning Postman classes:\n    - `pm.request.url` `pm.request.headers`\n    - Some features of `pm.response.headers` \n        - `pm.response.headers.get()` supported as of 1.9\n- The Hawk authentication method.\n- Deprecated `xmlToJson` method.\n- Request IDs are changed. Postman doesn't provide them in the export, so we have to generate new ones.\n\n## Other similar tools\n\n- [jmeter-to-k6](https://github.com/loadimpact/jmeter-to-k6/): Convert JMeter JMX files to k6 JS.\n\n## Credits\n\nSpecial thanks to the K6 team from [Grafana](https://github.com/grafana) for open-sourcing & growing the\nconverter and contributing it to the community. Thanks to [bookmoons](https://github.com/bookmoons) for creating this\ntool. Also, thanks to [borjacampina](https://github.com/borjacampina) for creating the original incarnation of the tool.\n","readmeFilename":"README.md"}