{"id":15062741,"url":"https://github.com/squareboat/nest-postman","last_synced_at":"2026-05-04T15:40:58.141Z","repository":{"id":144407844,"uuid":"492705191","full_name":"squareboat/nest-postman","owner":"squareboat","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-05T15:06:26.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-08T22:03:08.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/squareboat.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":"2022-05-16T06:09:54.000Z","updated_at":"2024-12-31T15:42:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed301963-3cbc-43db-a109-4527b339b06a","html_url":"https://github.com/squareboat/nest-postman","commit_stats":null,"previous_names":["chhabra1112/nest-postman"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squareboat%2Fnest-postman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squareboat%2Fnest-postman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squareboat%2Fnest-postman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squareboat%2Fnest-postman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squareboat","download_url":"https://codeload.github.com/squareboat/nest-postman/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243741223,"owners_count":20340425,"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":[],"created_at":"2024-09-24T23:45:28.584Z","updated_at":"2026-01-03T04:36:37.162Z","avatar_url":"https://github.com/squareboat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS Postman\n\nPostman Collection Generator for NestJS Rest API.\n\n## Table of Content\n\n- [NestJS Postman](#nest-postman)\n  - [Table of Content](#table-of-content)\n  - [Introduction](#introduction)\n  - [Installation](#installation)\n  - [Getting Started](#getting-started)\n    - [Static Registration](#static-registration)\n    - [Recommended Way](#recommended-way)\n  - [Usage](#usage)\n  - [License](#license)\n\n\n## Introduction\n\nThis library provides a simple way to generate a Postman collection for your NestJS Rest API app. With this library, you can easily export your API endpoints as a Postman collection, allowing you to test your API with Postman.\n\n---\n\n## Installation\n\n```python\n#Using NPM\nnpm i nest-postman\n\n#Using YARN\nyarn i nest-postman\n```\n\n---\n\n## Getting Started\n\nTo register `PostmanModule` with your app, import the module inside `AppModule` (your root module).\n\n#### Static Registration\n\n\u003e `PostmanModule` is added to global scope.\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { PostmanModule } from 'nest-postman'\n\n@Module({\n  imports: [\n    PostmanModule.register({\n      collectionName: process.env.APP_NAME || 'NestJS App',\n      url: process.env.APP_URL || `http://localhost:${process.env.APP_PORT}/`,\n      prefix: 'v1',\n      filePath: '',\n      description: 'This is my collection.'\n    })\n  ],\n  controllers: [],\n  providers: [],\n})\nexport class AppModule { }\n```\n\n#### Recommended Way\n\nUse `ConfigModule` provided by NestJS to load configurations. To learn about `ConfigModule`, [click here](https://docs.nestjs.com/techniques/configuration).\n\n**#1. Create postman.ts file**\n\n```typescript\nimport { PostmanOptions } from 'nest-postman/interfaces';\nimport { registerAs } from '@nestjs/config';\nexport default registerAs(\n  'postman',\n  () =\u003e\n    ({\n      collectionName: process.env.APP_NAME || 'NestJS App',\n      url: process.env.APP_URL || `http://localhost:${process.env.APP_PORT}/`,\n      prefix: 'v1',\n      filePath: '',\n      description: 'This is my collection.',\n    } as PostmanOptions),\n);\n```\n\n**#2. Register ConfigModule**\n\n```typescript\nimport { Module } from \"@nestjs/common\";\nimport postman from \"@config/fileystem\";\nimport { ConfigModule } from \"@nestjs/config\";\n\n@Module({\n  imports: [\n    ConfigModule.forRoot({\n      isGlobal: true,\n      expandVariables: true,\n      load: [postman],\n    }),\n  ],\n  controllers: [],\n  providers: [],\n})\nexport class AppModule {}\n```\n\n\n\n**#3. Register Async StorageModule**\nAdd following snippet to the `imports` array. `ConfigService` is importable from `@nestjs/config` module.\n\n```typescript\n PostmanModule.registerAsync({\n      imports: [ConfigModule],\n      useFactory: (config: ConfigService) =\u003e config.get('postman'),\n      inject: [ConfigService],\n    })\n```\n\n---\n## Usage\n\nAs soon as you run your app, there will be a file created with name collection.json in your project directory. Use that file to import in your postman application and *HOLA*, your postman collection is ready for use.\n\n\n### License\nThis library is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquareboat%2Fnest-postman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquareboat%2Fnest-postman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquareboat%2Fnest-postman/lists"}