{"id":18992855,"url":"https://github.com/ppcano/k6-typescript","last_synced_at":"2025-10-04T21:33:52.551Z","repository":{"id":42785955,"uuid":"274156510","full_name":"ppcano/k6-typescript","owner":"ppcano","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-06T09:35:30.000Z","size":955,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T02:19:52.590Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppcano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-22T14:15:10.000Z","updated_at":"2024-05-22T19:50:08.000Z","dependencies_parsed_at":"2023-02-05T19:32:10.502Z","dependency_job_id":null,"html_url":"https://github.com/ppcano/k6-typescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"grafana/k6-template-typescript","purl":"pkg:github/ppcano/k6-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppcano%2Fk6-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppcano%2Fk6-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppcano%2Fk6-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppcano%2Fk6-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppcano","download_url":"https://codeload.github.com/ppcano/k6-typescript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppcano%2Fk6-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278379554,"owners_count":25977214,"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-10-04T02:00:05.491Z","response_time":63,"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":[],"created_at":"2024-11-08T17:19:07.278Z","updated_at":"2025-10-04T21:33:52.515Z","avatar_url":"https://github.com/ppcano.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \n  ![banner](assets/ts-js-k6.png)\n\n# Using typescript with k6\n\n![.github/workflows/push.yml](https://github.com/k6io/example-typescript/workflows/.github/workflows/push.yml/badge.svg?branch=master)\n\n\u003c/div\u003e\n\n## Prerequisites\n\n- [k6](https://k6.io/docs/getting-started/installation)\n- [NodeJS](https://nodejs.org/en/download/)\n- [Yarn](https://yarnpkg.com/getting-started/install) (optional)\n\n## Rationale\n\nWhile JavaScript is great for a myriad of reasons, one area where it fall short is type safety and developer ergonomics. It's perfectly possible to write javascript code that will look OK and behave OK until a certain condition forces the executor into a faulty branch.\n\nWhile it, of course, still is possible to shoot yourself in the foot with typescript as well, it's significantly harder. Without adding much overhead, Typescript will:\n\n- Improve the ability to safely refactor your code.\n- Improve readability and maintainablity.\n- Allow you to drop a lot of the defensive code previously needed to make sure consumers are calling functions properly.\n\n## Project layout\n\nThis example project is split into four parts:\n\n- **the actual test script**, which contains none of the logic for interacting with the system under test.\n- **api endpoint objects**, serving the same purpose as page objects do in the [the page object model](\u003chttps://www.guru99.com/page-object-model-pom-page-factory-in-selenium-ultimate-guide.html#:~:text=Page%20Object%20Model%20(POM)%20is,duplication%20and%20improves%20test%20maintenance.\u003e) commonly used for UI testing.\n- **models** defining the shape of the data used in the tests\n- **helpers**, assisting with common operations.\n\n## Usage\n\nTo run a test written in typescript, we first have to transpile and bundle our project\n\n```bash\n$ yarn webpack\n```\n\nOnce that is done, we can run our script the same way we usually do, for instance:\n\n```bash\n$ k6 run dist/test.js \\\n    --vus 10 \\\n    --duration 10s\n```\n\n## Additional resources\n\n- [Examples published in the k6 docs](https://k6.io/docs/examples)\n- [Example projects available on GitHub](https://github.com/search?q=topic%3Aexamples+org%3Ak6io\u0026type=Repositories)\n- [A curated list of awesome k6 resources](https://github.com/k6io/awesome-k6/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppcano%2Fk6-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppcano%2Fk6-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppcano%2Fk6-typescript/lists"}