{"id":20337626,"url":"https://github.com/hugoalh/string-dissect-es","last_synced_at":"2026-01-26T19:26:06.319Z","repository":{"id":227044690,"uuid":"770271788","full_name":"hugoalh/string-dissect-es","owner":"hugoalh","description":"An ECMAScript module to dissect the string; Safe with the emojis, URLs, and words.","archived":false,"fork":false,"pushed_at":"2025-12-15T22:41:05.000Z","size":110,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T17:05:01.537Z","etag":null,"topics":["dissect","ecmascript","ecmascript-module","es","es-module","esm","esmodule","javascript","js","string","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hugoalh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-11T09:06:33.000Z","updated_at":"2025-11-11T10:03:08.000Z","dependencies_parsed_at":"2024-04-15T05:58:13.558Z","dependency_job_id":"aec9e6d3-7fae-4892-a8b2-d99ac56c6f3b","html_url":"https://github.com/hugoalh/string-dissect-es","commit_stats":null,"previous_names":["hugoalh-studio/string-dissect-ts","hugoalh-studio/string-dissect-es","hugoalh/string-dissect-es"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/hugoalh/string-dissect-es","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh%2Fstring-dissect-es","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh%2Fstring-dissect-es/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh%2Fstring-dissect-es/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh%2Fstring-dissect-es/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugoalh","download_url":"https://codeload.github.com/hugoalh/string-dissect-es/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh%2Fstring-dissect-es/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28785431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dissect","ecmascript","ecmascript-module","es","es-module","esm","esmodule","javascript","js","string","ts","typescript"],"created_at":"2024-11-14T21:09:38.696Z","updated_at":"2026-01-26T19:26:06.312Z","avatar_url":"https://github.com/hugoalh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# String Dissect (ES)\n\n[**⚖️** MIT](./LICENSE.md)\n\n[![GitHub: hugoalh/string-dissect-es](https://img.shields.io/github/v/release/hugoalh/string-dissect-es?label=hugoalh/string-dissect-es\u0026labelColor=181717\u0026logo=github\u0026logoColor=ffffff\u0026sort=semver\u0026style=flat \"GitHub: hugoalh/string-dissect-es\")](https://github.com/hugoalh/string-dissect-es)\n[![JSR: @hugoalh/string-dissect](https://img.shields.io/jsr/v/@hugoalh/string-dissect?label=@hugoalh/string-dissect\u0026labelColor=F7DF1E\u0026logo=jsr\u0026logoColor=000000\u0026style=flat \"JSR: @hugoalh/string-dissect\")](https://jsr.io/@hugoalh/string-dissect)\n[![NPM: @hugoalh/string-dissect](https://img.shields.io/npm/v/@hugoalh/string-dissect?label=@hugoalh/string-dissect\u0026labelColor=CB3837\u0026logo=npm\u0026logoColor=ffffff\u0026style=flat \"NPM: @hugoalh/string-dissect\")](https://www.npmjs.com/package/@hugoalh/string-dissect)\n\nAn ECMAScript module to dissect the string; Safe with the emojis, URLs, and words.\n\n## 🎯 Targets\n\n| **Runtime \\\\ Source** | **GitHub Raw** | **JSR** | **NPM** |\n|:--|:-:|:-:|:-:|\n| **[Bun](https://bun.sh/)** \u003e= v1.1.0 | ❌ | ✔️ | ✔️ |\n| **[Deno](https://deno.land/)** \u003e= v2.1.0 | ✔️ | ✔️ | ✔️ |\n| **[NodeJS](https://nodejs.org/)** \u003e= v20.9.0 | ❌ | ✔️ | ✔️ |\n\n## 🛡️ Runtime Permissions\n\nThis does not request any runtime permission.\n\n## #️⃣ Sources\n\n- GitHub Raw\n  ```\n  https://raw.githubusercontent.com/hugoalh/string-dissect-es/{Tag}/mod.ts\n  ```\n- JSR\n  ```\n  jsr:@hugoalh/string-dissect[@{Tag}]\n  ```\n- NPM\n  ```\n  npm:@hugoalh/string-dissect[@{Tag}]\n  ```\n\n\u003e [!NOTE]\n\u003e - It is recommended to include tag for immutability.\n\u003e - These are not part of the public APIs hence should not be used:\n\u003e   - Benchmark/Test file (e.g.: `example.bench.ts`, `example.test.ts`).\n\u003e   - Entrypoint name or path include any underscore prefix (e.g.: `_example.ts`, `foo/_example.ts`).\n\u003e   - Identifier/Namespace/Symbol include any underscore prefix (e.g.: `_example`, `Foo._example`).\n\n## ⤵️ Entrypoints\n\n| **Name** | **Path** | **Description** |\n|:--|:--|:--|\n| `.` | `./mod.ts` | Default. |\n\n## 🧩 APIs\n\n- ```ts\n  class StringDissector {\n    constructor(options?: StringDissectorOptions);\n    dissect(item: string): Generator\u003cStringSegmentDescriptor\u003e;\n  }\n  ```\n- ```ts\n  interface StringDissectorOptions {\n    locales?: Intl.LocalesArgument;\n    outputANSI?: boolean;\n    safeURLs?: boolean;\n    safeWords?: boolean;\n  }\n  ```\n- ```ts\n  interface StringSegmentDescriptor {\n    indexEnd: number;\n    indexStart: number;\n    type: StringSegmentType;\n    value: string;\n  }\n  ```\n- ```ts\n  type StringSegmentType =\n    | \"ansi\"\n    | \"character\"\n    | \"emoji\"\n    | \"url\"\n    | \"word\";\n  ```\n\n\u003e [!NOTE]\n\u003e - For the full or prettier documentation, can visit via:\n\u003e   - [Deno CLI `deno doc`](https://docs.deno.com/runtime/reference/cli/doc/)\n\u003e   - [JSR](https://jsr.io/@hugoalh/string-dissect)\n\n## ✍️ Examples\n\n- ```ts\n  const sample1 = \"Vel ex sit est sit est tempor enim et voluptua consetetur gubergren gubergren ut.\";\n\n  Array.from(new StringDissector().dissect(sample1));\n  //=\u003e\n  //  [\n  //    { value: \"Vel\", type: \"word\" },\n  //    { value: \" \", type: \"character\" },\n  //    { value: \"ex\", type: \"word\" },\n  //    { value: \" \", type: \"character\" },\n  //    { value: \"sit\", type: \"word\" },\n  //    { value: \" \", type: \"character\" },\n  //    { value: \"est\", type: \"word\" },\n  //    { value: \" \", type: \"character\" },\n  //    ... +20\n  //  ]\n\n  Array.from(new StringDissector({ safeWords: false }).dissect(sample1));\n  //=\u003e\n  //  [\n  //    { value: \"V\", type: \"character\" },\n  //    { value: \"e\", type: \"character\" },\n  //    { value: \"l\", type: \"character\" },\n  //    { value: \" \", type: \"character\" },\n  //    { value: \"e\", type: \"character\" },\n  //    { value: \"x\", type: \"character\" },\n  //    { value: \" \", type: \"character\" },\n  //    { value: \"s\", type: \"character\" },\n  //    ... +73\n  //  ]\n  ```\n- ```ts\n  Array.from(new StringDissector().dissect(\"GitHub homepage is https://github.com.\"));\n  //=\u003e\n  //  [\n  //    { value: \"GitHub\", type: \"word\" },\n  //    { value: \" \", type: \"character\" },\n  //    { value: \"homepage\", type: \"word\" },\n  //    { value: \" \", type: \"character\" },\n  //    { value: \"is\", type: \"word\" },\n  //    { value: \" \", type: \"character\" },\n  //    { value: \"https://github.com\", type: \"url\" },\n  //    { value: \".\", type: \"character\" }\n  //  ]\n  ```\n- ```ts\n  Array.from(new StringDissector().dissect(\"🤝💑💏👪👨‍👩‍👧‍👦👩‍👦👩‍👧‍👦🧑‍🤝‍🧑\"), ({ value }) =\u003e {\n    return value;\n  });\n  //=\u003e [ \"🤝\", \"💑\", \"💏\", \"👪\", \"👨‍👩‍👧‍👦\", \"👩‍👦\", \"👩‍👧‍👦\", \"🧑‍🤝‍🧑\" ]\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugoalh%2Fstring-dissect-es","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugoalh%2Fstring-dissect-es","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugoalh%2Fstring-dissect-es/lists"}