{"id":15481596,"url":"https://github.com/phara0h/postgen","last_synced_at":"2025-04-22T15:24:38.639Z","repository":{"id":74173297,"uuid":"203823567","full_name":"Phara0h/Postgen","owner":"Phara0h","description":"A simple node script to convert postman collections to clean REST client libs for node.","archived":false,"fork":false,"pushed_at":"2023-09-28T16:44:58.000Z","size":18935,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T17:03:38.790Z","etag":null,"topics":["cli","code","generate-code","generator","hacktoberfest","node-js","postman","postman-collection"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Phara0h.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-08-22T15:32:28.000Z","updated_at":"2024-04-17T11:29:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"4daac572-1602-4fd8-aa4f-a842beec4929","html_url":"https://github.com/Phara0h/Postgen","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phara0h%2FPostgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phara0h%2FPostgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phara0h%2FPostgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phara0h%2FPostgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Phara0h","download_url":"https://codeload.github.com/Phara0h/Postgen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250265719,"owners_count":21402161,"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":["cli","code","generate-code","generator","hacktoberfest","node-js","postman","postman-collection"],"created_at":"2024-10-02T05:05:05.313Z","updated_at":"2025-04-22T15:24:38.607Z","avatar_url":"https://github.com/Phara0h.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgen\n\nA simple node script to convert postman collections to clean REST client libs for node.\n\n## Install\n\n```\nnpm install -g postgen\n```\n\n## How to use\n\n* Export your collection from postman as a `v2.1` collection.\n* `cd` into your projects root folder that you want to use the client with.\n* Install `fasquest` as it is the only dependency of the generated client.\n```\nnpm install --save fasquest\n```\n* Run postgen for node SDK generation\n```\npostgen /path/to/postman/collection.js \u003e YourApi.js\n```\n\n* Run postgen for web SDK generation\n```\npostgen /path/to/postman/collection.js web \u003e YourApi.js\n```\n\n* View the examples on how to use your newly generated lib.\n\n## Examples\n\n### [Wasps with Bazookas](https://github.com/Phara0h/WaspsWithBazookas) Service\n\nA postman collection of the service:\n\n \u003cimg src=\"https://i.imgur.com/SssAdP5.png\" alt=\"https://www.npmjs.com/package/waspswithbazookas\" data-canonical-src=\"https://i.imgur.com/SssAdP5.png\"  width=\"330\"/\u003e\n\n#### Generated a class structure:\n```\nWaspsWithBazookas\n    |\n    |___Hive\n    |___Wasps\n    |___Wasp\n```\n\n#### Example use of the generation.\n```js\n\nconst WaspsWithBazookas = require('./WaspsWithBazookasAPI.js')(\n  'https://127.0.0.1:4269' // the url to service with no trailing /\n);\n\n// Start loadtest for 1second\nWWB.Hive.HivePoke({\n  \"t\": \"10\",\n  \"c\": \"50\",\n  \"d\": \"1\",\n  \"target\": \"http://127.0.0.1:4269/hive/status\"\n}).then(response=\u003e{\n  console.log(response)\n})\n\n// Wait 2 seconds and show the report\nsetTimeout(async ()=\u003e{\n  console.log((await WWB.Hive.HiveStatusReport()))\n},2000)\n\n```\n#### Samples\n\nSee the [samples](https://github.com/Phara0h/Postgen/blob/master/samples/) folder for the collection used and the generated API from that collection.\n\n### [Travelling](https://github.com/abeai/travelling) Service\n\nA postman collection of the service:\n\n \u003cimg src=\"https://i.imgur.com/2hD4oPU.png\" alt=\"https://www.npmjs.com/package/waspswithbazookas\" data-canonical-src=\"https://i.imgur.com/2hD4oPU.png\" width=\"330\" /\u003e\n\n#### Generated a class structure:\n```\nTravelling\n    |\n    |___Auth\n    |___Groups\n    |___User\n         |____Current\n```\n\n#### Example use of the generation.\n```js\n\nconst Travelling = require('./TravellingAPI.js')(\n  'https://127.0.0.1:6969' // the url to service with no trailing /\n);\n\nTravelling.Auth.login({\n  \"username\":\"test\",\n  \"password\":\"password1234\"\n}).then(response=\u003e{\n  console.log(response)\n})\n\n```\n\n#### Samples\n\nSee the [samples](https://github.com/Phara0h/Postgen/blob/master/samples/) folder for the collection used and the generated API from that collection.\n\n## Further Development\nThe code to do the generation is just some hacky code busted out in a hour. I would love help cleaning it up and making it more feature rich.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphara0h%2Fpostgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphara0h%2Fpostgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphara0h%2Fpostgen/lists"}