{"id":15097298,"url":"https://github.com/vaaski/spawncamp","last_synced_at":"2026-03-16T13:04:23.669Z","repository":{"id":256395358,"uuid":"855161586","full_name":"vaaski/spawncamp","owner":"vaaski","description":"A tiny library for userscripts that waits for elements to arrive in the DOM.","archived":false,"fork":false,"pushed_at":"2024-09-10T13:38:57.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-02T05:42:19.802Z","etag":null,"topics":["bun","greasemonkey","userscript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaaski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-10T12:19:14.000Z","updated_at":"2024-09-10T13:46:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8807e54-e378-4c50-b0a4-dd53eeab740b","html_url":"https://github.com/vaaski/spawncamp","commit_stats":null,"previous_names":["vaaski/spawncamp"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaski%2Fspawncamp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaski%2Fspawncamp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaski%2Fspawncamp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaski%2Fspawncamp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaaski","download_url":"https://codeload.github.com/vaaski/spawncamp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219842937,"owners_count":16556513,"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":["bun","greasemonkey","userscript"],"created_at":"2024-09-25T16:20:28.879Z","updated_at":"2025-12-24T13:31:48.237Z","avatar_url":"https://github.com/vaaski.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spawncamp\n\nA tiny library for userscripts that waits for elements to arrive in the DOM.\n\n## Installing\n\n```bash\nnpm i spawncamp\n```\n\n## Usage\n\n```ts\nimport { Spawncamp } from \"spawncamp\"\n\nconst camp = new Spawncamp()\n\n// Awaits the button element to arrive in the DOM once\nconst button = await camp.once(\"button\")\n\nbutton.addEventListener(\"click\", () =\u003e {\n\tconsole.log(\"Clicked!\")\n})\n\n// Calls the callback every time an element matching the selector arrives in the DOM\nconst remove = camp.on(\"button\", (element) =\u003e {\n\tconsole.log(\"New button just dropped\", element)\n})\n\n// Removes the observer for that selector\nremove()\n\n// Stops observing the DOM entirely\ncamp.stop()\n```\n\n## Development\n\nTo install dependencies:\n\n```bash\nbun install\n```\n\nRun tests:\n\n```bash\nbun test\n```\n\nBuild:\n\n```bash\nbun run build.ts\n```\n\nThis project was created using `bun init` with bun v1.1.27.\n\nIt uses [Biome](https://biomejs.dev) for formatting and linting.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaaski%2Fspawncamp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaaski%2Fspawncamp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaaski%2Fspawncamp/lists"}