https://github.com/scalajs-io/jsdom
A JavaScript implementation of the DOM and HTML standards
https://github.com/scalajs-io/jsdom
html jquery jsdom node nodejs npm npm-package scala scalajs
Last synced: 7 days ago
JSON representation
A JavaScript implementation of the DOM and HTML standards
- Host: GitHub
- URL: https://github.com/scalajs-io/jsdom
- Owner: scalajs-io
- License: apache-2.0
- Created: 2017-02-05T10:20:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T23:09:22.000Z (about 6 years ago)
- Last Synced: 2025-03-11T07:52:28.258Z (4 months ago)
- Topics: html, jquery, jsdom, node, nodejs, npm, npm-package, scala, scalajs
- Language: Scala
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Jsdom API for Scala.js
=======================
[jsdom](https://www.npmjs.com/package/jsdom) - A JavaScript implementation of the DOM and HTML standards.### Description
A JavaScript implementation of the DOM and HTML standards
### Build Dependencies
* [SBT v1.2.x](http://www.scala-sbt.org/download.html)
### Build/publish the SDK locally
```bash
$ sbt clean publish-local
```### Running the tests
Before running the tests the first time, you must ensure the npm packages are installed:
```bash
$ npm install
```Then you can run the tests:
```bash
$ sbt test
```### Examples
```scala
import io.scalajs.dom.html.HTMLAnchorElement
import io.scalajs.npm.jsdom._val doc = JsDom.jsdom("""
""")
val elem = doc.getElementsByClassName("the-link").headOption.orNull
assert(elem != null)val text = elem.asInstanceOf[HTMLAnchorElement].text
assert(text == "jsdom!")
```### Artifacts and Resolvers
To add the `Jsdom` binding to your project, add the following to your build.sbt:
```sbt
libraryDependencies += "io.scalajs.npm" %%% "jsdom" % "0.5.0"
```Optionally, you may add the Sonatype Repository resolver:
```sbt
resolvers += Resolver.sonatypeRepo("releases")
```