{"id":20720171,"url":"https://github.com/scalajs-io/dom-html","last_synced_at":"2025-09-09T19:39:15.394Z","repository":{"id":77422514,"uuid":"82511926","full_name":"scalajs-io/dom-html","owner":"scalajs-io","description":"DOM/HTML5 bindings for ScalaJs.io","archived":false,"fork":false,"pushed_at":"2019-06-17T23:06:17.000Z","size":107,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T07:52:31.038Z","etag":null,"topics":["canvas","dom","html","html5","scala","scalajs","web","webgl","websocket"],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/scalajs-io.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":"2017-02-20T03:17:47.000Z","updated_at":"2019-06-17T23:06:18.000Z","dependencies_parsed_at":"2023-09-05T23:16:14.192Z","dependency_job_id":null,"html_url":"https://github.com/scalajs-io/dom-html","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scalajs-io/dom-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fdom-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fdom-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fdom-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fdom-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalajs-io","download_url":"https://codeload.github.com/scalajs-io/dom-html/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalajs-io%2Fdom-html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274349670,"owners_count":25268979,"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":["canvas","dom","html","html5","scala","scalajs","web","webgl","websocket"],"created_at":"2024-11-17T03:19:33.548Z","updated_at":"2025-09-09T19:39:15.363Z","avatar_url":"https://github.com/scalajs-io.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"DOM-HTML API for Scala.js\n================================\nA collection of DOM-HTML bindings for Scala.js\n\n### Description\n\nA collection of DOM-HTML bindings for Scala.js\n\n### Build Dependencies\n\n* [SBT v1.2.x](http://www.scala-sbt.org/download.html)\n\n### Build/publish the SDK locally\n\n```bash\n $ sbt clean publish-local\n```\n\n### Running the tests\n\nBefore running the tests the first time, you must ensure the npm packages are installed:\n\n```bash\n$ npm install\n```\n\nThen you can run the tests:\n\n```bash\n$ sbt test\n```\n\n### Examples\n\n```scala\nimport io.scalajs.JSON\nimport scalajs.js\n\nval result = JSON.parseAs[js.Object](\"\"\"{\"x\":5}\"\"\", { (key: js.Any, value: js.Any) =\u003e value }: js.Function)\nprintln(JSON.stringify(result)) // {\"x\":5}\n```\n\nIn some cases, the NodeList is a live collection, which means that changes in the DOM are reflected in the collection. \nFor example, Node.childNodes is live:\n\n```scala\nimport io.scalajs.dom._\nimport io.scalajs.dom.html.browser._\n\nval parent = document.getElementById[ParentNode](\"parent\")\nval child_nodes = parent.childNodes\nconsole.log(child_nodes.length); // let's assume \"2\"\nparent.appendChild(document.createElement(\"div\"))\nconsole.log(child_nodes.length); // should output \"3\"\n```\n\nThe following example shows how to create a URLSearchParams object from a URL string.\n\n```scala\nimport io.scalajs.dom.html._\n\nval searchParams = new URLSearchParams(\"key1=value1\u0026key2=value2\")\n\n// Display the key/value pairs\nfor (value \u003c- searchParams.values()) {\n  println(value)\n}\n```\n\nThe performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds, \naccurate to five thousandths of a millisecond (5 microseconds).\n\n```scala\nimport io.scalajs.dom._\nimport io.scalajs.dom.html.browser._\n\ndef doSomething() {\n  // ...\n}\n\nval t0 = performance.now()\ndoSomething()\nval t1 = performance.now()\nconsole.log(\"Call to doSomething took \" + (t1 - t0) + \" milliseconds.\");\n```\n\n### Artifacts and Resolvers\n\nTo add the `DOM-HTML` bindings to your project, add the following to your build.sbt:  \n\n```sbt\nlibraryDependencies += \"io.scalajs\" %%% \"dom-html\" % \"0.5.0\"\n```\n\nOptionally, you may add the Sonatype Repository resolver:\n\n```sbt   \nresolvers += Resolver.sonatypeRepo(\"releases\") \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalajs-io%2Fdom-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalajs-io%2Fdom-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalajs-io%2Fdom-html/lists"}