{"id":20513853,"url":"https://github.com/webreflection/as-custom-element","last_synced_at":"2025-07-23T01:33:06.578Z","repository":{"id":57184504,"uuid":"282636506","full_name":"WebReflection/as-custom-element","owner":"WebReflection","description":"Setup any element as if it was a Custom Element","archived":false,"fork":false,"pushed_at":"2023-02-14T08:11:02.000Z","size":71,"stargazers_count":30,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T10:34:05.921Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebReflection.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}},"created_at":"2020-07-26T11:34:23.000Z","updated_at":"2024-09-02T13:20:09.000Z","dependencies_parsed_at":"2024-03-03T00:32:01.860Z","dependency_job_id":"70aede3f-ed7b-4be5-b86e-8e1322f031f6","html_url":"https://github.com/WebReflection/as-custom-element","commit_stats":{"total_commits":58,"total_committers":1,"mean_commits":58.0,"dds":0.0,"last_synced_commit":"3d8e2a3194f8489c8c2c16aedfadc8b40796b30c"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/WebReflection/as-custom-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fas-custom-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fas-custom-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fas-custom-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fas-custom-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/as-custom-element/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fas-custom-element/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266602801,"owners_count":23954696,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-11-15T21:13:32.111Z","updated_at":"2025-07-23T01:33:06.557Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# As Custom Element\n\nThe easiest way to add Custom Elements like callbacks to any node.\n\nCompatible with [modern browsers](https://webreflection.github.io/as-custom-element/test/), as well as [IE11](https://webreflection.github.io/as-custom-element/test/ie/), and no polyfills are needed, for a minified size less than *0.8K*.\n\n```js\nimport {upgrade, downgrade} from 'as-custom-element';\n\nconst someBehavior = {\n  // lifecycle callbacks\n  connectedCallback() {\n    console.log(this, 'is connected');\n  },\n  disconnectedCallback() {},\n\n  // attributes related helpers\n  observedAttributes: ['one', 'or', 'more'],\n  attributeChangedCallback(attributeName, oldValue, newValue) {}\n};\n\nupgrade(document.querySelector('#any'), someBehavior);\n\n// to drop the behavior at any time\ndowngrade(document.querySelector('#any'), someBehavior);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fas-custom-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebreflection%2Fas-custom-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fas-custom-element/lists"}