{"id":15003658,"url":"https://github.com/samthor/fast-text-encoding","last_synced_at":"2025-05-16T17:03:32.535Z","repository":{"id":37259708,"uuid":"102074555","full_name":"samthor/fast-text-encoding","owner":"samthor","description":"Fast polyfill for TextEncoder and TextDecoder, only supports UTF-8","archived":false,"fork":false,"pushed_at":"2025-02-10T23:10:04.000Z","size":120,"stargazers_count":106,"open_issues_count":6,"forks_count":31,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T15:57:46.361Z","etag":null,"topics":["encoding","javascript","utf-8"],"latest_commit_sha":null,"homepage":"","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/samthor.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":"2017-09-01T04:44:11.000Z","updated_at":"2025-04-05T16:09:06.000Z","dependencies_parsed_at":"2024-06-18T12:42:02.037Z","dependency_job_id":null,"html_url":"https://github.com/samthor/fast-text-encoding","commit_stats":{"total_commits":67,"total_committers":8,"mean_commits":8.375,"dds":"0.29850746268656714","last_synced_commit":"60d0a6cc787da13c2799c11cae48eba037f74548"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Ffast-text-encoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Ffast-text-encoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Ffast-text-encoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Ffast-text-encoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samthor","download_url":"https://codeload.github.com/samthor/fast-text-encoding/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573589,"owners_count":22093731,"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","javascript","utf-8"],"created_at":"2024-09-24T18:59:47.693Z","updated_at":"2025-05-16T17:03:32.487Z","avatar_url":"https://github.com/samthor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test](https://github.com/samthor/fast-text-encoding/actions/workflows/node.js.yml/badge.svg)](https://github.com/samthor/fast-text-encoding/actions/workflows/node.js.yml)\n\nThis is a fast polyfill for [`TextEncoder`][1] and [`TextDecoder`][2], which let you encode and decode JavaScript strings into UTF-8 bytes.\n\nIt is fast partially as it does not support^ any encodings aside UTF-8 (and note that natively, only `TextDecoder` supports alternative encodings anyway).\nSee [some benchmarks](https://github.com/samthor/fast-text-encoding/tree/master/bench).\n\n^If this polyfill used on Node v5.1 through v11 (when `Text...` was introduced), then this simply wraps `Buffer`, which supports many encodings and is native code.\n\n[1]: https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder\n[2]: https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder\n\n# Usage\n\nInstall as \"fast-text-encoding\" via your favourite package manager.\n\nYou only need this polyfill if you're supporting older browsers like IE, legacy Edge, ancient Chrome and Firefox, or Node before v11.\n\n## Browser\n\nInclude the minified code inside a `\u003cscript\u003e` tag or as an ES6 Module for its side effects.\nIt will create `TextEncoder` and `TextDecoder` if the symbols are missing on `window` or `global.`\n\n```html\n\u003cscript src=\"node_modules/fast-text-encoding/text.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"module\"\u003e\n  import './node_modules/fast-text-encoding/text.min.js';\n  import 'fast-text-encoding';  // or perhaps this\n  // confidently do something with TextEncoder or TextDecoder \\o/\n\u003c/script\u003e\n```\n\n⚠️ You'll probably want to depend on \"text.min.js\", as it's compiled to ES5 for older environments.\n\n## Not Including Polyfill\n\nIf your project doesn't need the polyfill, but is included as a transitive dependency, we publish [an empty version](https://www.npmjs.com/package/fast-text-encoding/v/0.0.0-empty) that you could pin NPM or similar's version algorithm to.\nUse \"fast-text-encoding@empty\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Ffast-text-encoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamthor%2Ffast-text-encoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Ffast-text-encoding/lists"}