{"id":13651390,"url":"https://github.com/grafana/k6-template-es6","last_synced_at":"2025-10-08T04:27:56.216Z","repository":{"id":40508139,"uuid":"250518612","full_name":"grafana/k6-template-es6","owner":"grafana","description":"Template using Webpack and Babel to enable ES6 features in k6 tests","archived":false,"fork":false,"pushed_at":"2024-08-30T22:43:02.000Z","size":100,"stargazers_count":88,"open_issues_count":2,"forks_count":20,"subscribers_count":152,"default_branch":"main","last_synced_at":"2025-05-13T14:51:09.135Z","etag":null,"topics":["babel","bundling","es6","javascript","k6","load-testing","performance-testing","templates","webpack"],"latest_commit_sha":null,"homepage":"https://k6.io/docs/using-k6/modules#bundling-node-modules","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana.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":"2020-03-27T11:37:41.000Z","updated_at":"2025-05-13T14:19:20.000Z","dependencies_parsed_at":"2024-01-03T05:40:24.667Z","dependency_job_id":"5afc448e-cecf-4558-8ff8-11dac9fc109b","html_url":"https://github.com/grafana/k6-template-es6","commit_stats":{"total_commits":16,"total_committers":7,"mean_commits":"2.2857142857142856","dds":0.6875,"last_synced_commit":"5cea41d6b4ee754b35921b531332a8ff10c93b3f"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/grafana/k6-template-es6","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fk6-template-es6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fk6-template-es6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fk6-template-es6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fk6-template-es6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/k6-template-es6/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fk6-template-es6/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278891027,"owners_count":26063852,"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-08T02:00:06.501Z","response_time":56,"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":["babel","bundling","es6","javascript","k6","load-testing","performance-testing","templates","webpack"],"created_at":"2024-08-02T02:00:48.907Z","updated_at":"2025-10-08T04:27:56.186Z","avatar_url":"https://github.com/grafana.png","language":"JavaScript","funding_links":[],"categories":["Examples/Templates"],"sub_categories":[],"readme":"\u003e [!WARNING]\n\u003e This template is deprecated due to native ES6+TypeScript support released in k6 [v0.52.0](https://github.com/grafana/k6/releases/tag/v0.52.0). Set the `--compatibility-mode=experimental_enhanced` option to use it. Check the [documentation for the details](https://grafana.com/docs/k6/latest/using-k6/javascript-typescript-compatibility-mode/#experimental-enhanced-mode).\n\nThis is a template repository showing how to use `Babel` and `Webpack` to bundle the different files into CommonJS modules, using its [`webpack.config.js`](./webpack.config.js) configuration.\n\nIn this project, you can write k6 tests using:\n1. node module resolution.\n2. external node modules and getting them automatically bundled.\n3. unsupported ES+ features like the optional chaining ( `?.` ) operator.\n\n## Installation\n\nClick **Use this template** to create a repository from this template. \n\nClone the generated repository on your local machine, move to the project root folder and install the dependencies defined in [`package.json`](./package.json)\n\n```bash\nnpm install\n```\n\n## Running the test\n\nAttempting to run the tests in [src](./src/) will fail because:\n-  k6 does not know how to resolve node modules.\n-  k6 does not recognize some ES+ features like the optional chaining ( `?.` ) operator. \n\nTo address this, we'll use `Webpack` to bundle the dependencies and polyfill ES+ features.\n\n```bash\nnpm run bundle\n```\n\nThis command creates the final test files to the `./dist` folder.\n\nOnce that is done, we can run our script the same way we usually do, for instance:\n\n```bash\nk6 run dist/optional-chaining-test.js\n# or \nk6 run dist/faker-test.js\n```\n\n## See also\n\n- [Using k6 / Modules](https://grafana.com/docs/k6/latest/using-k6/modules/)\n- [Using k6 / JavaScript compatibility mode](https://grafana.com/docs/k6/latest/using-k6/javascript-compatibility-mode/)\n- [grafana/k6-rollup-example](https://github.com/grafana/k6-rollup-example)\n- [grafana/k6-template-typescript](https://github.com/grafana/k6-template-typescript)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fk6-template-es6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fk6-template-es6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fk6-template-es6/lists"}