# iterable-lookahead

> Iterable wrapper that add methods to read ahead or behind current item.

Latest version **2.0.0** (published 2017-06-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install iterable-lookahead
pnpm add iterable-lookahead
yarn add iterable-lookahead
bun add iterable-lookahead
```

## 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 | 2.0.0 |
| Published | 2017-06-28 |
| First published | 2016-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Andrea Parodi |
| Maintainers | parroit |
| Keywords | iterable, generator, ahead, behind, functional, look-behind, look-ahead, lookbehind, lookahead |

## Links

- npm: https://www.npmjs.com/package/iterable-lookahead
- Repository: https://github.com/parro-it/iterable-lookahead
- Homepage: https://github.com/parro-it/iterable-lookahead#readme
- Issues: https://github.com/parro-it/iterable-lookahead/issues
- npm.io page: https://npm.io/package/iterable-lookahead

## Recent versions

- 2.0.0 (latest) — 2017-06-28
- 1.0.0 — 2016-09-13

## README

# iterable-lookahead

[![Greenkeeper badge](https://badges.greenkeeper.io/parro-it/iterable-lookahead.svg)](https://greenkeeper.io/)
[![Travis Build Status](https://img.shields.io/travis/parro-it/iterable-lookahead.svg)](http://travis-ci.org/parro-it/iterable-lookahead)
[![Coveralls](https://img.shields.io/coveralls/parro-it/iterable-lookahead.svg?maxAge=2592000)](https://coveralls.io/github/parro-it/iterable-lookahead)
[![NPM module](https://img.shields.io/npm/v/iterable-lookahead.svg)](https://npmjs.org/package/iterable-lookahead)
[![NPM downloads](https://img.shields.io/npm/dt/iterable-lookahead.svg)](https://npmjs.org/package/iterable-lookahead)

> Iterable wrapper that add methods to read ahead or behind current item.



# Installation

```bash
npm install --save iterable-lookahead
```

## Usage

```js
	const lookahead = require('iterable-lookahead');
	const iterable = lookahead([1, 2, 3, 4]);

	for (const item of iterable) {
		console.log({
			item,
			ahead: iterable.ahead(1),
			behind: iterable.behind(1)
		});
	}

```

or otherwise, using array spread syntax:

```js
	const lookahead = require('iterable-lookahead');

	for (const [item, look] of lookahead.spread([1, 2, 3, 4])) {
		console.log({
			item,
			ahead: look.ahead(1),
			behind: look.behind(1)
		});
	}

```

# License

The MIT License (MIT)

Copyright (c) 2016 Andrea Parodi

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