{"id":15937225,"url":"https://github.com/knowler/log-form-element","last_synced_at":"2025-07-25T08:04:23.537Z","repository":{"id":210282038,"uuid":"726194901","full_name":"knowler/log-form-element","owner":"knowler","description":"A custom element that will log a form’s submissions to the console.","archived":false,"fork":false,"pushed_at":"2025-02-06T03:13:58.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T02:51:15.225Z","etag":null,"topics":["custom-elements","web-components"],"latest_commit_sha":null,"homepage":"https://knowler.github.io/log-form-element/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knowler.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":"2023-12-01T18:32:57.000Z","updated_at":"2025-02-12T14:39:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"cff4766e-4a3a-4c1d-9fe1-86348001ea66","html_url":"https://github.com/knowler/log-form-element","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"c1571fe4c7b79ef56f0c909cbd15ddbbe896e5fb"},"previous_names":["knowler/log-form-element"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/knowler/log-form-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowler%2Flog-form-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowler%2Flog-form-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowler%2Flog-form-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowler%2Flog-form-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knowler","download_url":"https://codeload.github.com/knowler/log-form-element/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowler%2Flog-form-element/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266977758,"owners_count":24015479,"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-25T02:00:09.625Z","response_time":70,"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":["custom-elements","web-components"],"created_at":"2024-10-07T05:01:30.607Z","updated_at":"2025-07-25T08:04:23.497Z","avatar_url":"https://github.com/knowler.png","language":"JavaScript","funding_links":[],"categories":["Utility Elements"],"sub_categories":[],"readme":"# `\u003clog-form\u003e`: Log Form element\n\n\u003cp\u003e\u003ca href=https://jsr.io/@knowler/log-form-element\u003e\u003cimg src=https://jsr.io/badges/@knowler/log-form-element alt=\"@knowler/log-form-element on JSR\"\u003e\u003c/a\u003e\u003c/p\u003e\n\nWrap a `\u003cform\u003e` element with this `\u003clog-form\u003e` element and when submitted,\ninstead of using the default action, it’ll log the form data to the console.\n\n## Usage\n\nThe element is published on [JSR][] (which can be used as an NPM registry) or\nyou can use a CDN like [esm.sh][] to import the module.\n\nBy default, the module exports the class for you to define yourself. The class\nhas a `define()` method which can be used to easily define the element either\nusing a default tag name of `log-form` or whatever one you pass it.\n\n```javascript\nimport { LogFormElement } from \"https://esm.sh/jsr/@knowler/log-form-element\";\n\nLogFormElement.define();\n```\n\nYou can also add a `?define` search param to the module’s URL which it’ll use to\nautomatically register the custom element using the default tag name. If you are\nusing a CDN, you might need to add a `?raw` param so that the `define` param\napplies to module URL itself.\n\n```html\n\u003cscript type=module src=\"https://esm.sh/jsr/@knowler/log-form-element?raw\u0026define\"\u003e\u003c/script\u003e\n```\n\nOnce the element is registered. You can wrap `\u003cform\u003e` elements with it and then\nopen your console to debug submission.\n\n```html\n\u003clog-form\u003e\n\t\u003cform\u003e\n\t\t\u003clabel\u003ePizza toppings \u003cinput name=pizza-toppings\u003e\u003c/label\u003e\n\t\t\u003cbutton\u003eSubmit\u003c/button\u003e\n\t\u003c/form\u003e\n\u003c/log-form\u003e\n```\n\n## Examples\n\n- [Basic](https://knowler.github.io/log-form-element/examples/basic)\n- [Auto-define](https://knowler.github.io/log-form-element/examples/auto-define)\n\n[JSR]: https://jsr.io/\n[esm.sh]: https://esm.sh/\n[jsr:@knowler/log-form-element]: https://jsr.io/@knowler/log-form-element\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowler%2Flog-form-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknowler%2Flog-form-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowler%2Flog-form-element/lists"}