# iterify

> Makes a value iterable if it isn’t already.

Latest version **1.0.0** (published 2018-05-23) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2018-05-23 |
| First published | 2018-05-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 3 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | John Lamansky |
| Maintainers | lamansky |
| Keywords | iterable |

## Links

- npm: https://www.npmjs.com/package/iterify
- Repository: https://github.com/lamansky/iterify
- Issues: https://github.com/lamansky/iterify/issues
- npm.io page: https://npm.io/package/iterify

## Dependencies (3)

- [sbo](https://npm.io/package/sbo.md) ^1.1.0
- [is-nil](https://npm.io/package/is-nil.md) ^1.0.1
- [is-iterable](https://npm.io/package/is-iterable.md) ^1.1.1

## Recent versions

- 1.0.0 (latest) — 2018-05-23

## README

# iterify

Makes a value iterable if it isn’t already.

## Installation

Requires [Node.js](https://nodejs.org/) 4.0.0 or above.

```bash
npm i iterify
```

## API

The module exports a single function.

### Parameter

Bindable: `x` (any): The value to make iterable.

### Return Values

* If `x` is iterable, returns `x` as-is.
* If `x` is `undefined` or `null`, returns an empty array.
* Otherwise, returns a one-element array containing `x`.

## Example

```javascript
const iterify = require('iterify')

iterify([123]) // [123]
iterify(123) // [123]
iterify(null) // []
```

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