{"id":29081956,"url":"https://github.com/silent-watcher/express-to-postman","last_synced_at":"2025-06-27T20:03:02.061Z","repository":{"id":299942051,"uuid":"997894048","full_name":"Silent-Watcher/express-to-postman","owner":"Silent-Watcher","description":"Generate Postman Collections automatically from your Express.js application routes.","archived":false,"fork":false,"pushed_at":"2025-06-08T13:12:44.000Z","size":280,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-27T02:44:03.950Z","etag":null,"topics":["expressjs","nodejs","postman","postman-api","postman-collection"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/express-to-postman","language":"TypeScript","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/Silent-Watcher.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,"zenodo":null}},"created_at":"2025-06-07T12:24:12.000Z","updated_at":"2025-06-26T15:20:00.000Z","dependencies_parsed_at":"2025-06-19T04:04:15.539Z","dependency_job_id":null,"html_url":"https://github.com/Silent-Watcher/express-to-postman","commit_stats":null,"previous_names":["silent-watcher/express-to-postman"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Silent-Watcher/express-to-postman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Silent-Watcher%2Fexpress-to-postman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Silent-Watcher%2Fexpress-to-postman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Silent-Watcher%2Fexpress-to-postman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Silent-Watcher%2Fexpress-to-postman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Silent-Watcher","download_url":"https://codeload.github.com/Silent-Watcher/express-to-postman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Silent-Watcher%2Fexpress-to-postman/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262324906,"owners_count":23293749,"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":["expressjs","nodejs","postman","postman-api","postman-collection"],"created_at":"2025-06-27T20:01:32.829Z","updated_at":"2025-06-27T20:03:02.046Z","avatar_url":"https://github.com/Silent-Watcher.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![express-to-postman](./.github/express-to-postman.png)\n\n# express-to-postman\n\nGenerate Postman Collections automatically from your Express.js application routes.\n\n## Features\n\n* Auto-detect Express routes including nested routers\n* Supports both JavaScript (ESM/CJS) and TypeScript entry files\n* Bundles local route modules while externalizing npm dependencies\n* Generates a valid Postman Collection v2.1 JSON file\n* Groups routes by first URL segment for better organization\n* CLI tool with simple usage and flexible input/output options\n\n## Installation\n\nInstall globally for system-wide use:\n\n```sh\nnpm install -g express-to-postman\n```\n\nOr add as a dev dependency in your project:\n\n```sh\nnpm install --save-dev express-to-postman\n```\n\n## Basic Usage\n\nRun the CLI against your Express app entry point:\n\n```sh\nexpress-to-postman -i path/to/your/express/app.js -o output/collection.json\n```\n\n* `-i`, `--input` — Entry file path for your Express app (must export `app`)\n* `-o`, `--output` — Output path for the generated Postman collection JSON (default: `postman.collection.json`)\n* `-v`, `--verbose` — Enable verbose logging (default: `false`)\n\n## Detailed Examples\n\n### JavaScript (ESM)\n\nAssume your `server.js` looks like:\n\n```js\nimport express from 'express';\nexport const app = express();\napp.get('/users', (req, res) =\u003e res.json([]));\n```\n\nGenerate a collection:\n\n```sh\nexpress-to-postman -i ./server.js -o ./users-collection.json\n```\n\n### TypeScript\n\nSupport for `.ts` entry files is built-in via on-the-fly transpilation:\n\n```ts\nimport express from 'express';\nimport router from './routes';\nexport const app = express();\napp.use(router);\n```\n\n```sh\nexpress-to-postman -i ./src/app.ts -o postman.json\n```\n\n## Advanced Options\n\n* **Auto-detect dependencies**: Reads your project’s `package.json` to externalize all npm packages during bundling.\n* **Custom grouping**: Routes are grouped by the first path segment (`/users`, `/comments`).\n* **Verbose logging**: Pass `-v` or `--verbose` to print intermediate logs and the full generated collection JSON.\n\n## Troubleshooting\n\n* **Missing dependencies**: If the CLI complains it cannot find a package (e.g. `express`), make sure your app’s root `package.json` is detected correctly. The CLI searches upward from your entry file for `package.json`.\n* **Routes not detected**: Verify that your Express app exports a named `app` and that routes are registered before `app.listen()`.\n\n## Configuration\n\nYou can also import and use `generateCollection()` programmatically in Node:\n\n```js\nimport { generateCollection } from 'express-to-postman';\n\n(async () =\u003e {\n  await generateCollection(\n    './dist/app.js',\n    './collection.json',\n    true // verbose\n  );\n})();\n```\n\n## License\n\n[project License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilent-watcher%2Fexpress-to-postman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilent-watcher%2Fexpress-to-postman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilent-watcher%2Fexpress-to-postman/lists"}