# @wpe-tkpd/jsdom

> A JavaScript implementation of many web standards

Latest version **23.0.2** (published 2024-05-30) · Proprietary license · 0 weekly downloads

## Install

```sh
npm install @wpe-tkpd/jsdom
pnpm add @wpe-tkpd/jsdom
yarn add @wpe-tkpd/jsdom
bun add @wpe-tkpd/jsdom
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 23.0.2 |
| Published | 2024-05-30 |
| First published | 2021-01-18 |
| Weekly downloads | 0 |
| License | Proprietary |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18.17 <19 |
| Dependencies | 25 |
| Unpacked size | 2.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | victorirawan, andywihalim2, antonybudianto, prakasa1904, miqdadfwz, skipper.team, 1nd, adjieguntoro |
| Keywords | dom, html, whatwg, w3c |

## Links

- npm: https://www.npmjs.com/package/@wpe-tkpd/jsdom
- npm.io page: https://npm.io/package/@wpe-tkpd/jsdom

## Dependencies (25)

- [ws](https://npm.io/package/ws.md) ^8.13.0
- [abab](https://npm.io/package/abab.md) ^2.0.6
- [acorn](https://npm.io/package/acorn.md) ^8.8.2
- [saxes](https://npm.io/package/saxes.md) ^6.0.0
- [nwsapi](https://npm.io/package/nwsapi.md) ^2.2.4
- [parse5](https://npm.io/package/parse5.md) ^7.1.2
- [cssstyle](https://npm.io/package/cssstyle.md) ^3.0.0
- [data-urls](https://npm.io/package/data-urls.md) ^4.0.0
- [escodegen](https://npm.io/package/escodegen.md) ^2.0.0
- [form-data](https://npm.io/package/form-data.md) ^4.0.0
- [whatwg-url](https://npm.io/package/whatwg-url.md) ^12.0.1
- [rrweb-cssom](https://npm.io/package/rrweb-cssom.md) ^0.6.0
- [symbol-tree](https://npm.io/package/symbol-tree.md) ^3.2.4
- [domexception](https://npm.io/package/domexception.md) ^4.0.0
- [tough-cookie](https://npm.io/package/tough-cookie.md) ^4.1.2
- [acorn-globals](https://npm.io/package/acorn-globals.md) ^7.0.0
- [whatwg-encoding](https://npm.io/package/whatwg-encoding.md) ^2.0.0
- [whatwg-mimetype](https://npm.io/package/whatwg-mimetype.md) ^3.0.0
- [http-proxy-agent](https://npm.io/package/http-proxy-agent.md) ^5.0.0
- [https-proxy-agent](https://npm.io/package/https-proxy-agent.md) ^5.0.1
- [w3c-xmlserializer](https://npm.io/package/w3c-xmlserializer.md) ^4.0.0
- [webidl-conversions](https://npm.io/package/webidl-conversions.md) ^7.0.0
- [xml-name-validator](https://npm.io/package/xml-name-validator.md) ^4.0.0
- [html-encoding-sniffer](https://npm.io/package/html-encoding-sniffer.md) ^3.0.0
- [is-potential-custom-element-name](https://npm.io/package/is-potential-custom-element-name.md) ^1.0.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 23.0.2 (latest) — 2024-05-30
- 22.1.2-beta.0 (beta) — 2024-04-24
- 23.0.1 — 2024-05-29
- 23.0.0 — 2024-05-21
- 23.0.0-beta.0 — 2024-05-21
- 22.1.2 — 2024-04-24
- 22.1.1 — 2023-07-03
- 22.1.0 — 2023-07-03
- 16.7.2 — 2023-06-16
- 16.7.1 — 2022-01-20
- 16.7.0 — 2021-04-02
- 16.6.0 — 2021-04-02
- 16.5.2 — 2021-02-03
- 16.5.1 — 2021-01-18
- 16.5.0 — 2021-01-18

## README

This is fork of `jsdom`. Originally forked because we need to not import/require `canvas` and we need to use custom `decimal.js`.

## Tests

### Running the tests

1. Run `nvm use` to ensure you use the Node.js version expected by this package.
2. Run `pnpm i` to install all dependencies.

To run all the tests: `pnpm test`

In the following sections, we'll give commands for running a subset of the tests. If you do that, instead of running the whole suite with `pnpm test`, then please run this command first:

Before running test subsets: `pnpm pretest`

### Web platform feature tests

All tests for web platform features (as opposed to features of jsdom itself, such as the JSDOM() constructor) should be in web-platform-tests format. We have some infrastructure for running these directly against jsdom documents. So ideally, when contributing a bugfix or new feature, you can browse the web-platform-tests repository and find the test covering your work, and then just enable it in the to-run.yaml file. These tests are HTML files which use a special library called testharness.js to report their results.

However, the web-platform-tests project is not fully comprehensive. If you need to write your own test for a web platform feature, place it in our to-upstream directory. (It's so named because, over time, we hope to upstream these tests back to the web-platform-tests repository, so all browsers can benefit from them.) Note that you may need to create new directory structure, paralleling that of the main web-platform-tests repository.

To run all web-platform-tests: `pnpm test-wpt`

To run the to-upstream web-platform-tests: `pnpm test-tuwpt`

To run specific web-platform-tests already enabled via to-run.yaml: `pnpm test-wpt --fgrep dom/events`

To run specific to-upstream web-platform-tests: `pnpmp test-tuwpt --fgrep domparsing`

Also, to update web platform tests to their latest revision from the source repository: `pnpm update-wpt`. (This can take a long time, like 10 minutes.)

### jsdom API tests

If you are testing something that can only be accomplished through the jsdom API, and not inside a normal web browser, you'll want to write a different kind of test. Such tests are written using Mocha and Chai.

To write such a test that, simply add a file in `test/api/`, following the surrounding conventions. Then, add it to the manifest at `test/index.js`.

To run all API tests: `pnpm test-api`

To run a specific API test: `pnpm test-mocha test/api/from-file.js`

### Older tests

Although ideally you should not need to worry about this, there are some tests that are for legacy reasons not in the right format; they use Mocha, but really should be web platform tests. We're keeping them around for coverage until we can convert them. If you run `pnpm test`, you will get the full test suite, including such old tests.

---
_Source: https://npm.io/package/@wpe-tkpd/jsdom · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
