# js-partition

> Partition iterable collection into groups of n items

Latest version **1.0.0** (published 2015-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-partition
pnpm add js-partition
yarn add js-partition
bun add js-partition
```

## 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 | 2015-10-06 |
| First published | 2015-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Roman Liutikov |
| Maintainers | roman01la |
| Keywords | partition |

## Links

- npm: https://www.npmjs.com/package/js-partition
- Repository: https://github.com/roman01la/js-partition
- Homepage: https://github.com/roman01la/js-partition#readme
- Issues: https://github.com/roman01la/js-partition/issues
- npm.io page: https://npm.io/package/js-partition

## Dependencies (1)

- [js-take](https://npm.io/package/js-take.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2015-10-06

## README

# js-partition
Partition iterable collection into groups of `n` items

## Installation

```
$ npm i js-partition
```

## Usage

`partition(n, [step], [pad], coll);`

```javascript
import partition from 'js-partition';

partition(2, [1, 2, 3, 4]); // [[1, 2], [3, 4]]
partition(2, new Set([1, 2, 3, 4])); // [[1, 2], [3, 4]]
partition(2, Immutable.List([1, 2, 3, 4])); // [[1, 2], [3, 4]]

partition(2, 1, [1, 2, 3, 4]); // [[1, 2], [2, 3], [3, 4]]
partition(3, 3, [0], [1, 2, 3, 4]); // [[1, 2, 3], [4, 0]]
```

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