{"id":15270308,"url":"https://github.com/gherking/gpc-for-loop","last_synced_at":"2025-07-28T05:05:04.260Z","repository":{"id":35799764,"uuid":"219361157","full_name":"gherking/gpc-for-loop","owner":"gherking","description":"A precompiler of GherKing to loop scenarios and scenario outlines to repeat them.","archived":false,"fork":false,"pushed_at":"2024-11-17T04:31:45.000Z","size":916,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-19T07:44:26.680Z","etag":null,"topics":["cucumber","feature-file","gherkin","gherking","gpc","hacktoberfest","precompiler","typescript"],"latest_commit_sha":null,"homepage":"https://gherking.github.io/gpc-for-loop/","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/gherking.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,"zenodo":null}},"created_at":"2019-11-03T20:28:33.000Z","updated_at":"2025-07-11T15:54:21.000Z","dependencies_parsed_at":"2023-01-16T06:41:14.389Z","dependency_job_id":"12b4d536-5629-4297-9b0e-cce1cf869104","html_url":"https://github.com/gherking/gpc-for-loop","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/gherking/gpc-for-loop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gherking%2Fgpc-for-loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gherking%2Fgpc-for-loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gherking%2Fgpc-for-loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gherking%2Fgpc-for-loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gherking","download_url":"https://codeload.github.com/gherking/gpc-for-loop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gherking%2Fgpc-for-loop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267464522,"owners_count":24091505,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cucumber","feature-file","gherkin","gherking","gpc","hacktoberfest","precompiler","typescript"],"created_at":"2024-09-30T07:08:10.170Z","updated_at":"2025-07-28T05:05:04.231Z","avatar_url":"https://github.com/gherking.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gpc-for-loop\n\n![Downloads](https://img.shields.io/npm/dw/gpc-for-loop?style=flat-square) ![Version@npm](https://img.shields.io/npm/v/gpc-for-loop?label=version%40npm\u0026style=flat-square) ![Version@git](https://img.shields.io/github/package-json/v/gherking/gpc-for-loop/master?label=version%40git\u0026style=flat-square) ![CI](https://img.shields.io/github/actions/workflow/status/gherking/gpc-for-loop/ci.yml?branch=main\u0026label=ci\u0026style=flat-square) ![Docs](https://img.shields.io/github/actions/workflow/status/gherking/gpc-for-loop/docs.yml?branch=main\u0026label=docs\u0026style=flat-square)\n\nA precompiler of GherKing to loop scenarios and scenario outlines to repeat them.\n\nIn the case of scenario outlines, it copies all rows of examples, resulting in _iterator_ × _rows_ number of scenarios when tests are run.\n\n## Usage\n\nIdentify scenario or scenario outline to be repeated and mark it with `${loopTag}(${i})` e.g. `@loop(4)`.\n\nThe precompiler will then repeat this scenario or scenario outline for `${i}` times, modifying its name according to the format.\n\nConfigurable variables and their default options:\n\n|      Option       |      Default       | Description                                                                                                  |\n| :---------------: | :----------------: | :----------------------------------------------------------------------------------------------------------- |\n|    `maxValue`     |         10         | Maximum value of repeat (for explicit loops, not applicable for iterations)                                  |\n|     `tagName`     |      `'loop'`      | Tag used to mark scenarios or outlines to be repeated                                                        |\n|     `format`      | `'${name} (${i})'` | Format of the scenario or outline name after repeating                                                       |\n|   `startIndex`    |         1          | The first index to use when repeating a scenario                                                             |\n| `limitToMaxValue` |       `true`       | Whether higher repeat values than the max should be limited to the max or error should be thrown ( `false` ) |\n|     `keepTag`     |      `false`       | Whether the loop tags should be kept or removed (default)                                                    |\n|   `iterations`    |         -          | An object of iteration name and values (named repeat values)                                                 |\n\nIf `iterations` is set, the keys of the iterations object can be used as values of the loop tag, to use predefined repeat values. For example, if iterations is `{ \"stress\": 5 }` then `@loop(stress)` means repeating 5 times.\n\nSee examples for the input files and output in the test/data folder.\n\n```javascript\n\"use strict\";\nconst compiler = require(\"gherking\");\nconst ForLoop = require(\"gpc-for-loop\");\n\nlet ast = await compiler.load(\"./features/src/login.feature\");\nast = compiler.process(\n  ast,\n  new ForLoop({\n    // config\n  }),\n);\nawait compiler.save(\"./features/dist/login.feature\", ast, {\n  lineBreak: \"\\r\\n\",\n});\n```\n\n```typescript\n\"use strict\";\nimport { load, process, save } from \"gherking\";\nimport ForLoop = require(\"gpc-for-loop\");\n\nlet ast = await load(\"./features/src/login.feature\");\nast = process(\n  ast,\n  new ForLoop({\n    // config\n  }),\n);\nawait save(\"./features/dist/login.feature\", ast, {\n  lineBreak: \"\\r\\n\",\n});\n```\n\n## Other\n\nThis package uses [debug](https://www.npmjs.com/package/debug) for logging, use `gpc:for-loop` :\n\n```shell\nDEBUG=gpc:for-loop* gherking ...\n```\n\nFor detailed documentation see the [TypeDocs documentation](https://gherking.github.io/gpc-for-loop/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgherking%2Fgpc-for-loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgherking%2Fgpc-for-loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgherking%2Fgpc-for-loop/lists"}