https://github.com/quentinroy/pairwise
https://github.com/quentinroy/pairwise
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/quentinroy/pairwise
- Owner: QuentinRoy
- License: other
- Created: 2018-01-29T12:39:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T14:06:04.000Z (over 1 year ago)
- Last Synced: 2025-04-16T22:09:40.901Z (about 1 year ago)
- Language: JavaScript
- Size: 177 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pairwise
[](https://travis-ci.org/QuentinRoy/pairwise)
[](https://codecov.io/gh/QuentinRoy/pairwise)
[](https://david-dm.org/quentinroy/pairwise)
[](https://david-dm.org/quentinroy/pairwise?type=dev)
[](https://www.npmjs.com/package/pairwise)
Chunk an array into successive pairs.
E.g. `pairwise([1, 2, 3, 4])` yields `[[1, 2], [2, 3], [3, 4]]`.
## Installing / Getting started
`npm i pairwise`
## Example
```js
const pairwise = require('pairwise');
const chunks = pairwise([1, 2, 3, 4, 5]);
```