# has-dom

> Check if a JavaScript environment has a DOM

Latest version **2.0.0** (published 2021-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install has-dom
pnpm add has-dom
yarn add has-dom
bun add has-dom
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-05-03 |
| First published | 2015-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 2.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | browsers, dom, js, javascript, env, environment, has, detect, check |

## Links

- npm: https://www.npmjs.com/package/has-dom
- Repository: https://github.com/sindresorhus/has-dom
- Homepage: https://github.com/sindresorhus/has-dom#readme
- Issues: https://github.com/sindresorhus/has-dom/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/has-dom

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-05-03
- 1.0.1 — 2018-03-23
- 1.0.0 — 2015-01-17

## README

# has-dom

> Check if a JavaScript environment has a [DOM](https://en.wikipedia.org/wiki/Document_Object_Model)

## Install

```
$ npm install has-dom
```

## Usage

```js
import hasDom from 'has-dom';

// In Node.js
hasDom();
//=> false

// In the browser
hasDom();
//=> true
```

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