{"id":15363838,"url":"https://github.com/javieraviles/har2postman","last_synced_at":"2025-06-15T12:05:34.650Z","repository":{"id":39320942,"uuid":"243049214","full_name":"javieraviles/Har2Postman","owner":"javieraviles","description":"Javascript Har to Postman converter","archived":false,"fork":false,"pushed_at":"2023-05-08T03:23:20.000Z","size":211,"stargazers_count":48,"open_issues_count":4,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-16T06:19:20.633Z","etag":null,"topics":["converter","har","postman"],"latest_commit_sha":null,"homepage":"https://javieraviles.github.io/Har2Postman/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javieraviles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-25T16:49:09.000Z","updated_at":"2025-04-30T09:19:09.000Z","dependencies_parsed_at":"2024-10-16T06:20:56.554Z","dependency_job_id":null,"html_url":"https://github.com/javieraviles/Har2Postman","commit_stats":{"total_commits":72,"total_committers":5,"mean_commits":14.4,"dds":"0.38888888888888884","last_synced_commit":"5c492d0a2fb57e9af91e0140fc2159b17692fb0a"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/javieraviles/Har2Postman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javieraviles%2FHar2Postman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javieraviles%2FHar2Postman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javieraviles%2FHar2Postman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javieraviles%2FHar2Postman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javieraviles","download_url":"https://codeload.github.com/javieraviles/Har2Postman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javieraviles%2FHar2Postman/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259971330,"owners_count":22940009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["converter","har","postman"],"created_at":"2024-10-01T13:08:42.565Z","updated_at":"2025-06-15T12:05:34.621Z","avatar_url":"https://github.com/javieraviles.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Har2Postman\n[![npm version](https://badge.fury.io/js/har2postman.svg)](https://badge.fury.io/js/har2postman)\n\n![Har2Postman](https://raw.githubusercontent.com/javieraviles/har2postman/master/docs/assets/img/logo.png) \n\nJavascript Har to Postman converter. [Try it out](https://javieraviles.github.io/Har2Postman/)\n\n## Purpose\nThe main goal of the project is the creation of a JS library to convert `.har` files to Postman requests/collection in `.JSON` format.\n\n`HTTP Archive format` or `HAR` files are a JSON-formatted archive file format for logging of a web browser's interaction with a site (HTTP transactions).\n\nOn the other hand `Postman` is a testing API client tool, allowing us to test a request against a specific environment.\n\nThe intended *audience* is, therefore, anybody who finds a use case where this library is useful in any way.\n\n## Getting Started\n\n### Install package\n\n```bash\nnpm install har2postman\n```\n\n### Example\n\n```javascript\nvar Har2Postman = require('har2postman');\n\nvar includeTests = true;\nharToPostman.createPostmanCollection(stringifiedHarFile, includeTests);\n```\n\n### Options\n\n- `includeTests`: default `false`, set to `true` for including test assertions in requests\n\n\n## Authors\n\n* **Rafael Paez** - [rafapaezbas](https://github.com/rafapaezbas)\n* **Javier Aviles** - [javieraviles](https://github.com/javieraviles)\n\n## Roadmap\nPlease note every version should include a suite of test cases ensuring new requirements are working. The last test case of the suite should check the library produces a `JSON` output matching the content of the file `/test/x.x.x/output.json` given a `JSON` input matching the content of the file `/test/x.x.x/input.json`.\n\n### v0.1.0 - Convert simplest GET request from HAR to Postman\n* Create a first basic JS `createPostmanCollection` function able to produce a valid postman collection including the expected `file` (postman metadata) and `item` (request itself) objects out of a `har` file.\n* Create a CI pipeline, executing jasmine tests on every push and updating the `Har2Postman` in npm if new tag is released.\n\n### v0.2.0 - Create simple postman test for a GET request\n* The output file should also include basic test assertions in GET requests for postman based on the response section from `har` file (response code, maybe id if path param?).\n* The `createPostmanCollection` function should include a second optional `boolean` argument to decide whether the output should include the test section or not. By default, the behaviour of the boolean flag should be `false`.\n* Include basic usage example for the lib in docs.\n\n### v0.3.0 - GET request might include query params\n* A GET request might include multiple `query params`; those should also be mapped from the har file to the postman collection. Evaluate whether some of them (FK?) should be included as part of the test assertions.\n* Evaluate if response is an array, if so, generate test assertion.\n* Evaluate if response is not a json file, if so generate only status code assertion.\n* CI pipeline should also include integration tests on tag release: using the just released version of the lib, generate a postman collection using the version input, and run it with newman so it checks the lib output works out of the box.\n* Include ESLint, with some format scripts in the package and check the linting from the pipeline too.\n\n### v0.4.0 - Support multiple requests within one har file\n* A `har` file can contain multiple requests, and all them should be contained within the swagger collection.\n* The provided examples contain api versioning; the lib should be able to deal with them.\n\n### v0.5.0 - POST, PUT and DELETE methods should also be supported\n* Even though the method is already picked up by the lib, some methods such POST or PUT might include a body.\n* Some headers such `Content-Type` should be included in the request.\n\n### v0.6.0 - Any status code must be supported\n* Status code such as 200, 204, 400, 401, 403 or 404 must have specific assertions.\n* Non-json responses should even not tried to be analysed.\n\n### v0.7.0 - Relevant headers should be included\n* Include relevant headers for each request, only the necessary ones.\n* Make library compatible for Browser.\n* Demo page automatically getting lib from cdn.\n\n### v0.7.5 - Add cli execution\n* Include the option for converting a har file into a collection from the command line.\n\n### Future features still to be planned\n* Url hostname of requests, if common, should come from an env variable\n* Auth methods should not be included as simple headers, but collection auth method and inherit from there in every request\n* support `xml` format\n* when creating an object, might be interesting to save it's `id` if contained in response as env variable for future requests over same entity (GET, PUT or DELETE)\n* Prepare nice docs\n* Make sure every function generates only one type of data structure. F.e. this should be avoided: \n\n```javascript\nvar generateItem = function(){\n  var item = [{\n          name: generateItemName(harRequest.method, harRequestUrl.pathname, harResponse.status, generateTest),\n          event: generateItemEvent(harResponse, harRequestUrl),\n          request: {\n              method: harRequest.method,\n              url: {\n                  raw: harRequestUrl.toString(),\n                  protocol: harRequestUrl.protocol.slice(0, -1),\n                  host: harRequestUrl.hostname.split('.'),\n                  path: harPathnameArray.slice(1)\n              }\n          }\n      }];\n}\n\n```\n\nThe right way for this function would be: \n\n```javascript\n var generateItem = function(){\n  return  [{\n          name: generateItemName(harRequest.method, harRequestUrl.pathname, harResponse.status, generateTest),\n          event: generateItemEvent(harResponse, harRequestUrl),\n          request: generateRequest(harRequest, harRequestUrl);\n      }];\n}\n\nvar generateRequest = function(){\n  return {\n           method: harRequest.method,\n           url: generateUrl(harRequestUrl);\n         }\n}\n\n//var generateUrl = function() ...\n\n```\n\n**Also important** have a look at the functions returning arrays instead of objects, this will have to change in the future if those arrays need more than one element.\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavieraviles%2Fhar2postman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavieraviles%2Fhar2postman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavieraviles%2Fhar2postman/lists"}