# @zcomp/closest

> Same as `$.fn.closest` from jQuery, but without jQuery. Does not modify any global objects or prototypes. Gracefully falls back to using native `Element.closest` and `Element.matches` if ones are available. The only requirement is native `Element.query

Latest version **0.0.4** (published 2018-01-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zcomp/closest
pnpm add @zcomp/closest
yarn add @zcomp/closest
bun add @zcomp/closest
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2018-01-01 |
| First published | 2017-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zenwarr |
| Maintainers | zenwarr |

## Links

- npm: https://www.npmjs.com/package/@zcomp/closest
- Repository: https://github.com/zenwarr/zw-closest
- Homepage: https://github.com/zenwarr/zw-closest#readme
- Issues: https://github.com/zenwarr/zw-closest/issues
- npm.io page: https://npm.io/package/@zcomp/closest

## Recent versions

- 0.0.4 (latest) — 2018-01-01
- 0.0.3 — 2018-01-01
- 0.0.2 — 2017-12-13
- 0.0.1 — 2017-12-13

## README

# What is it?

Same as `$.fn.closest` from jQuery, but without jQuery.
Does not modify any global objects or prototypes.
Gracefully falls back to using native `Element.closest` and `Element.matches` if ones are available.
The only requirement is native `Element.querySelectorAll` method, so it is compatible with all browsers except IE <= 7.

# Installation

```
npm i --save @zcomp/closest
```

# Usage

```javascript
const closest = require('@zcomp/closest');

closest(document.body, 'html');
```

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