# matches-selector-universal

> Check if an element matches a given selector

Latest version **1.0.5** (published 2016-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install matches-selector-universal
pnpm add matches-selector-universal
yarn add matches-selector-universal
bun add matches-selector-universal
```

## 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 | 1.0.5 |
| Published | 2016-09-13 |
| First published | 2016-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | 1stdibs, antialias |
| Keywords | match, element, CSS, selector |

## Links

- npm: https://www.npmjs.com/package/matches-selector-universal
- Repository: https://github.com/1stdibs/matches-selector-universal
- Homepage: https://github.com/1stdibs/matches-selector-universal#readme
- Issues: https://github.com/1stdibs/matches-selector-universal/issues
- npm.io page: https://npm.io/package/matches-selector-universal

## Dependencies (2)

- [global-object](https://npm.io/package/global-object.md) ^1.0.0
- [component-query](https://npm.io/package/component-query.md) 0.0.3

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2016-09-13
- 1.0.4 — 2016-09-13
- 1.0.3 — 2016-09-13
- 1.0.2 — 2016-09-13
- 1.0.1 — 2016-09-13
- 1.0.0 — 2016-09-13

## README

# matches-selector-universal

Check if an element matches a given selector.

## History

This package is useful when bundling a library that will be used for universal rendering.
It was forked from a merge of component-matches-selector and matches-selector. Both packages threw errors when required from an environment that didn't have global DOM objects. matches-selector-universal fixes that, but for obvious reasons, will still throw errors if DOM globals, e.g. `document` and `Element` aren't available.

## Installation

    $ npm install matches-selector-universal

## Example

```js
var matches = require('matches-selector-universal');
matches(el, 'ul li a');
// => true or false
```

## Running Tests

Tests are run with karma + mocha + webpack. An additional test is performed to ensure that the code does not throw errors when required by node with no DOM globals.

```
npm install
npm test
```

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