# make-array

> Creates a real Array from almost anything.

Latest version **1.0.5** (published 2018-08-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install make-array
pnpm add make-array
yarn add make-array
bun add make-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.5 |
| Published | 2018-08-02 |
| First published | 2014-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | kael |
| Maintainers | kael |
| Keywords | make-array, to-array, makearray, toarray, array, iterate |

## Links

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

## Recent versions

- 1.0.5 (latest) — 2018-08-02
- 1.0.3 — 2018-01-25
- 1.0.2 — 2017-05-19
- 1.0.1 — 2015-12-18
- 1.0.0 — 2015-12-18
- 0.1.2 — 2014-07-22
- 0.1.1 — 2014-07-21
- 0.1.0 — 2014-07-21

## README

[![NPM version](https://badge.fury.io/js/make-array.svg)](http://badge.fury.io/js/make-array)
[![Build Status](https://travis-ci.org/kaelzhang/make-array.svg?branch=master)](https://travis-ci.org/kaelzhang/make-array)

# make-array

Creates a real Array from almost anything.

## Install

```bash
$ npm i make-array --save
```

## Usage

```js
var makeArray = require('make-array');
makeArray();              // []
makeArray(undefined);     // []
makeArray(null);          // []
makeArray(1);             // [1]
makeArray([1, 2]);        // [1, 2]
makeArray({
  '0': 1,
  '1': 2,
  length: 2
});                       // [1, 2]

function foo (){
  return makeArray(arguments);
}

foo(1, 2, 3);             // [1, 2, 3]
```

### makeArray(subject, [host])

- subject `mixed` things you want to make it an array
- host `Array=` if `host` is specified, the newly-created array will append to the end of the `host`

Returns `Array`. If `host` is specified, it will return the `host` itself.

```js
var host = [1, 2];
function foo(){
  return arguments;
}

var result = makeArray(foo({}, []), host);
result;           // [1, 2, {}, []];
result === host;  // true
```

## Changelog

**1.0.0**: bump version to mark it as stable.

## License

MIT
<!-- do not want to make nodeinit to complicated, you can edit this whenever you want. -->

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