# cast-array

> Ensure a value is an array and wrap it if it is not an array

Latest version **1.0.1** (published 2015-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install cast-array
pnpm add cast-array
yarn add cast-array
bun add cast-array
```

## 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.1 |
| Published | 2015-11-13 |
| First published | 2015-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | array, wrap, cast |

## Links

- npm: https://www.npmjs.com/package/cast-array
- Repository: https://github.com/bendrucker/cast-array
- Homepage: https://github.com/bendrucker/cast-array#readme
- Issues: https://github.com/bendrucker/cast-array/issues
- npm.io page: https://npm.io/package/cast-array

## Dependencies (1)

- [isarray](https://npm.io/package/isarray.md) 0.0.1

## Recent versions

- 1.0.1 (latest) — 2015-11-13
- 1.0.0 — 2015-09-04

## README

# cast-array [![Build Status](https://travis-ci.org/bendrucker/cast-array.svg?branch=master)](https://travis-ci.org/bendrucker/cast-array)

> Ensure a value is an array and wrap it if it is not an array


## Install

```
$ npm install --save cast-array
```


## Usage

```js
var castArray = require('cast-array')

castArray('input')
//=> ['input']

castArray(['input'])
//=> ['input']
```

## API

#### `castArray(value)` -> `array`

##### value

*Required*  
Type: `array` / `any`

A value to wrap in an array (unless it's already an array).


## License

MIT © [Ben Drucker](http://bendrucker.me)

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