{"id":16641828,"url":"https://github.com/samthor/split-dom","last_synced_at":"2025-09-09T11:11:41.064Z","repository":{"id":66115193,"uuid":"142254872","full_name":"samthor/split-dom","owner":"samthor","description":"Helper JavaScript to split DOM nodes within text","archived":false,"fork":false,"pushed_at":"2020-04-22T02:50:19.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T10:09:53.851Z","etag":null,"topics":["dom","html"],"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":"2018-07-25T06:06:33.000Z","updated_at":"2023-09-07T08:17:08.000Z","dependencies_parsed_at":"2023-02-20T19:31:00.022Z","dependency_job_id":null,"html_url":"https://github.com/samthor/split-dom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samthor/split-dom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fsplit-dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fsplit-dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fsplit-dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fsplit-dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samthor","download_url":"https://codeload.github.com/samthor/split-dom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samthor%2Fsplit-dom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274289044,"owners_count":25257856,"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-09-09T02:00:10.223Z","response_time":80,"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":["dom","html"],"created_at":"2024-10-12T07:48:01.216Z","updated_at":"2025-09-09T11:11:41.003Z","avatar_url":"https://github.com/samthor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Helper to split DOM nodes at a position within text.\nThis is not published anywhere.\n\nCreate a `SliceIndex` if you'll be doing this a lot, otherwise, you can just use the top-level `slice` method. \n\nUsage:\n\n```js\nimport {SliceIndex, slice} from './path/to/split.js';\n\nconst dom = `\u003cdiv\u003eHello \u003cstrong\u003eThere\u003c/strong\u003e\u003c/div\u003e`;\n\n// #1: SliceIndex\nconst index = new SliceIndex(dom);  // accepts node (cloned) or string\nindex.slice(0, 4);  // `\u003cdiv\u003eHell\u003c/div\u003e`\nindex.slice(8);     // `\u003cdiv\u003e\u003cstrong\u003eere\u003c/strong\u003e\u003c/div\u003e`\n\n// #2: slice()\nconst node = document.createElement('div');\nnode.innerHTML = dom;\nslice(node, 0, 4);  // same as above, but not indexed and without copy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Fsplit-dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamthor%2Fsplit-dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamthor%2Fsplit-dom/lists"}