# 1d

> Make multi-dimensional arrays as flat as a pancake

Latest version **1.0.0** (published 2020-03-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install 1d
pnpm add 1d
yarn add 1d
bun add 1d
```

## 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 | 2020-03-18 |
| First published | 2018-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Terkel Gjervig |
| Maintainers | terkelg |
| Keywords | array, flatten, flat, reduce |

## Links

- npm: https://www.npmjs.com/package/1d
- Repository: https://github.com/terkelg/1d
- Issues: https://github.com/terkelg/1d/issues
- npm.io page: https://npm.io/package/1d

## Recent versions

- 1.0.0 (latest) — 2020-03-18
- 0.1.1 — 2019-08-05
- 0.1.0 — 2018-02-18

## README

<div align="center">
  <img src="https://github.com/terkelg/1d/raw/master/1d.png" alt="1D" width="200" />
</div>

<h1 align="center">1D</h1>

<div align="center">
  <a href="https://npmjs.org/package/1d">
    <img src="https://img.shields.io/npm/v/1d.svg" alt="version" />
  </a>
  <a href="https://travis-ci.org/terkelg/1d">
    <img src="https://img.shields.io/travis/terkelg/1d.svg" alt="travis" />
  </a>
  <a href="https://npmjs.org/package/1d">
    <img src="https://img.shields.io/npm/dm/1d.svg" alt="downloads" />
  </a>
</div>

<div align="center">Make multi-dimensional arrays as flat as a pancake</div>

<br />


## Installation

```
npm install 1d
```


## Usage

```js
const flatten = require('1d');

flatten( [['a'], 'b', ['c', ['d']]] );
// ['a', 'b', 'c', 'd']
```

> **OBS**: This is a built-in feature from Node.js `11.15.0` and up. Check out
[Array.prototype.flat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)

## API

### oned(arr, res)

Flatten an array into a sweet 1D array

#### arr

Type: `Array`

Input array to flatten

#### res

Type: `Array`<br>
Default: `[]`

Initial array.

> **Note**: The inital array is not being flattened


## License

MIT © [Terkel Gjervig](https://terkel.com)

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