{"id":18157511,"url":"https://github.com/ubermanu/arrosoir","last_synced_at":"2025-04-07T02:42:44.100Z","repository":{"id":57184276,"uuid":"462703832","full_name":"ubermanu/arrosoir","owner":"ubermanu","description":"🚿 Hydrate HTML with a selector and a url","archived":false,"fork":false,"pushed_at":"2024-01-28T15:00:52.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-08T17:01:54.122Z","etag":null,"topics":["dom","html","hydration"],"latest_commit_sha":null,"homepage":"https://www.skypack.dev/view/arrosoir","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ubermanu.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":"2022-02-23T11:22:28.000Z","updated_at":"2022-10-07T08:45:33.000Z","dependencies_parsed_at":"2024-12-20T14:48:18.341Z","dependency_job_id":"b5955f3a-def4-4aad-ba4d-181902891e16","html_url":"https://github.com/ubermanu/arrosoir","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubermanu%2Farrosoir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubermanu%2Farrosoir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubermanu%2Farrosoir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubermanu%2Farrosoir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ubermanu","download_url":"https://codeload.github.com/ubermanu/arrosoir/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247584060,"owners_count":20962071,"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":["dom","html","hydration"],"created_at":"2024-11-02T06:06:27.514Z","updated_at":"2025-04-07T02:42:44.031Z","avatar_url":"https://github.com/ubermanu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arrosoir\n\n[![CI](https://github.com/ubermanu/arrosoir/actions/workflows/ci.yml/badge.svg)](https://github.com/ubermanu/arrosoir/actions/workflows/ci.yml)\n\nSmall DOM hydration function for generated HTML.\n\n### Install\n\n    npm install arrosoir\n\n### Usage\n\n```js\nimport { hydrate } from 'arrosoir'\nawait hydrate(selector, url)\n```\n\nFor example:\n\n```html\n\u003cscript type=\"module\"\u003e\n    import { hydrate } from 'https://cdn.skypack.dev/arrosoir'\n\n    const url = new URL(location.href)\n    let p = url.searchParams.get('p') * 1 || 1\n\n    document.querySelector('button.load-more').addEventListener('click', async () =\u003e {\n        url.searchParams.set('p', ++p)\n        await hydrate('ul.list', url.toString(), { merge: 'append' })\n    })\n\u003c/script\u003e\n```\n\n\u003e The previous example fetches the page with a different query string.\u003cbr\u003e\n\u003e The `hydrate` function will merge the new HTML into the existing DOM.\n\n### Options\n\n- `merge`: Append the new HTML to the selector.\n- `history`: Replace the current URL with the fetched one.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubermanu%2Farrosoir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fubermanu%2Farrosoir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubermanu%2Farrosoir/lists"}