{"id":13342869,"url":"https://github.com/oleiade/xk6-encoding","last_synced_at":"2025-04-13T12:45:19.308Z","repository":{"id":173340360,"uuid":"650616787","full_name":"oleiade/xk6-encoding","owner":"oleiade","description":"TextDecoder and TextEncoder support for k6","archived":false,"fork":false,"pushed_at":"2023-11-06T08:10:15.000Z","size":54,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T21:53:52.870Z","etag":null,"topics":["encoding","k6","k6-extension","xk6"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleiade.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":"2023-06-07T12:51:14.000Z","updated_at":"2024-05-22T16:42:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"fbfec358-258a-40bf-a355-5beb8331ed0e","html_url":"https://github.com/oleiade/xk6-encoding","commit_stats":null,"previous_names":["oleiade/xk6-encoding"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleiade%2Fxk6-encoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleiade%2Fxk6-encoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleiade%2Fxk6-encoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleiade%2Fxk6-encoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleiade","download_url":"https://codeload.github.com/oleiade/xk6-encoding/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717241,"owners_count":21150387,"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":["encoding","k6","k6-extension","xk6"],"created_at":"2024-07-29T19:30:06.413Z","updated_at":"2025-04-13T12:45:19.288Z","avatar_url":"https://github.com/oleiade.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `TextEncoder` and `TextDecoder` implementations for k6\n\nWelcome to xk6-encoding, an xk6 extension that brings support for Javascript's TextEncoder and TextDecoder to k6, enabling you to seamlessly handle various text encodings during your performance tests.\n\n## Features\n\n* **Text Encoding**: Convert your strings into byte streams with support for various encoding formats including UTF-8, UTF-16, and Windows-1252.\n* **Text Decoding**: Decode byte streams back to strings with ease, even when processing the data in chunks.\n* **Flexible Options**: Handle Byte Order Marks (BOM) and determine behavior on decoding invalid data.\n\n## Why Use xk6-encoding?\n\nIf you're working with systems that utilize various text encodings or if you're aiming to test the performance of encoding/decoding tasks, this extension will be invaluable for your k6 tests.\n\n## Getting Started\n\n1. Make sure you have the latest version of the xk6 tool installed:\n\n```bash\ngo install go.k6.io/xk6/cmd/xk6@latest\n```\n\n2. Build your custom k6 binary:\n\n```bash\nxk6 build --with github.com/oleiade/xk6-encoding@latest\n```\n\n3. Use in your k6 script:\nTo encode text:\n\n```javascript\nimport { TextEncoder } from 'k6/encoding';\nconst encoder = new TextEncoder(\"utf-8\");\nconst encoded = encoder.Encode(\"Your text here\");\n```\n\nTo decode text:\n```javascript\nimport { TextDecoder } from 'k6/encoding';\nconst decoder = new TextDecoder(\"utf-8\");\nconst decoded = decoder.Decode(encodedData);\n```\n\n4. Run your k6 test with the custom k6 binary you built:\n\n```bash\n./k6 run your-test-script.js\n```\n\n## Supported Encodings\n\n* **utf-8**: Standard encoding for the web.\n* **utf-16le** and **utf-16be**: Unicode encodings that can represent any character in the Unicode standard.\n* **windows-1252**: A character encoding of the Latin alphabet, used by default in the legacy components of Microsoft Windows.\n\n## Contributing\nYour contributions are always welcome! If you discover an issue or have a feature request, please open an issue on the GitHub repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleiade%2Fxk6-encoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleiade%2Fxk6-encoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleiade%2Fxk6-encoding/lists"}