# @alexspirgel/normalize-elements

> A utility function that returns an array of element references from a variety of argument types.

Latest version **1.0.2** (published 2021-12-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @alexspirgel/normalize-elements
pnpm add @alexspirgel/normalize-elements
yarn add @alexspirgel/normalize-elements
bun add @alexspirgel/normalize-elements
```

## 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.2 |
| Published | 2021-12-15 |
| First published | 2021-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexander Spirgel |
| Maintainers | alexspirgel |
| Keywords | normalize-elements, normalizeelements, normalize, elements |

## Links

- npm: https://www.npmjs.com/package/@alexspirgel/normalize-elements
- Repository: https://github.com/alexspirgel/normalize-elements
- Homepage: https://github.com/alexspirgel/normalize-elements#readme
- Issues: https://github.com/alexspirgel/normalize-elements/issues
- npm.io page: https://npm.io/package/@alexspirgel/normalize-elements

## Dependencies (1)

- [@alexspirgel/is-element](https://npm.io/package/@alexspirgel/is-element.md) ^1.0.4

## Recent versions

- 1.0.2 (latest) — 2021-12-15
- 1.0.1 — 2021-12-15
- 1.0.0 — 2021-12-15

## README

# Normalize Elements
A utility function that returns an array of element references from a variety of argument types.

Valid argument types include:
* element reference
* css selector string
* query selectors (`document.querySelector`, `document.querySelectorAll`, or any node list)
* an array including any combination of the above

## Installation

### Using NPM:

```js
npm install @alexspirgel/normalize-elements
```

```js
const normalizeElements = require('@alexspirgel/normalize-elements');
```

## Usage

```js
let elements = normalizeElements(document.body); // element reference
let elements = normalizeElements('.example-selector'); // css selector string
let elements = normalizeElements(document.querySelectorAll('.another-selector')); // query selector (node list)
let elements = normalizeElements([ // an array including any combination of the above.
	document.body,
	'.example-selector',
	document.querySelectorAll('.another-selector')
]);
```

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