# bianco.dom-to-array

> Converts any DOM node/s to a loopable array

Latest version **1.1.0** (published 2022-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install bianco.dom-to-array
pnpm add bianco.dom-to-array
yarn add bianco.dom-to-array
bun add bianco.dom-to-array
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-03-09 |
| First published | 2016-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gianluca Guarini |
| Maintainers | gianlucaguarini, nirazul, nilssolanki |
| Keywords | es6, es2015, dom, array, iterator, dom loops, nodes |

## Links

- npm: https://www.npmjs.com/package/bianco.dom-to-array
- Repository: https://github.com/biancojs/dom-to-array
- Homepage: https://github.com/biancojs/dom-to-array#readme
- Issues: https://github.com/biancojs/dom-to-array/issues
- npm.io page: https://npm.io/package/bianco.dom-to-array

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-03-09
- 1.0.0 — 2018-12-01
- 0.0.10 — 2018-06-03
- 0.0.9 — 2018-05-03
- 0.0.8 — 2017-03-21
- 0.0.7 — 2017-02-19
- 0.0.6 — 2017-02-19
- 0.0.5 — 2016-10-22
- 0.0.4 — 2016-09-21
- 0.0.2 — 2016-09-17
- 0.0.1 — 2016-09-17

## README

# bianco.dom-to-array

[![Build Status][ci-image]][ci-url]
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![MIT License][license-image]][license-url]

## Usage

```js
import domToArray from 'bianco.dom-to-array'

var div = document.createElement('div')
div.innerHTML = `
  <ul>
    <li>one</li>
    <li>two</li>
  </ul>
`
body.appendChild(div)

// It can convert node list
const lis = document.querySelectorAll('li')
const $lis = domToArray(lis)
$lis.length // => 2
Array.isArray($lis) // => true

// It can convert a single node
const li = document.querySelector('li')
const $li = domToArray(li)
$li.length // => 1
Array.isArray($li) // => true
```

[ci-image]:https://img.shields.io/github/workflow/status/biancojs/dom-to-array/test?style=flat-square
[ci-url]:https://github.com/biancojs/dom-to-array/actions

[license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]: LICENSE.txt

[npm-version-image]: http://img.shields.io/npm/v/bianco.dom-to-array.svg?style=flat-square
[npm-downloads-image]: http://img.shields.io/npm/dm/bianco.dom-to-array.svg?style=flat-square
[npm-url]: https://npmjs.org/package/bianco.dom-to-array

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [domToArray](#domtoarray)
    -   [Parameters](#parameters)

### domToArray

Converts any DOM node/s to a loopable array

#### Parameters

-   `els` **([HTMLElement](https://developer.mozilla.org/docs/Web/HTML/Element) \| [NodeList](https://developer.mozilla.org/docs/Web/API/NodeList))** single html element or a node list

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** always a loopable object

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