# arrayify

> Convert array like items or individual items into arrays

Latest version **1.0.0** (published 2013-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install arrayify
pnpm add arrayify
yarn add arrayify
bun add arrayify
```

## 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.0 |
| Published | 2013-07-08 |
| First published | 2013-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | ForbesLindesay |
| Maintainers | forbeslindesay |

## Links

- npm: https://www.npmjs.com/package/arrayify
- Repository: https://github.com/ForbesLindesay/arrayify
- npm.io page: https://npm.io/package/arrayify

## Recent versions

- 1.0.0 (latest) — 2013-07-08

## README

# arrayify

Convert array like items or individual items into arrays (for both browser and server)

[![Build Status](https://travis-ci.org/ForbesLindesay/arrayify.png?branch=master)](https://travis-ci.org/ForbesLindesay/arrayify)
[![Dependency Status](https://gemnasium.com/ForbesLindesay/arrayify.png)](https://gemnasium.com/ForbesLindesay/arrayify)
[![NPM version](https://badge.fury.io/js/arrayify.png)](http://badge.fury.io/js/arrayify)

## Installation

    npm install arrayify

## Usage

```js
// Array-likes
var divs = document.getElementsByTagName('div') // `NodeList` of `HTMLDivElement`
toArray(divs) // => Array of `HTMLDivElement`

(function() {
  toArray(arguments) // => [1, 2]
})(1, 2)

// Primitives
toArray('hello') // => ['hello']
toArray(12345) // => [12345]
toArray(/regex/) // => [/regex/]
toArray(null) // => [null]
toArray({}) // => [{}]
toArray(new Date) // => [Wed Nov 07 2012 04:40:26 GMT+1000 (EST)]

// Special cases
toArray(undefined) // => []
toArray(window) // => [window]
toArray('a.important', {query: true}) // => [DOM elements matching the query selector 'a.important']
```

## License

This library is based off of work by [@timoxley](https://github.com/timoxley) on the [to-array component](https://github.com/timoxley/to-array) which is MIT licensed.

This library is therefore also MIT licensed.

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