# take-while

> Returns an array of successive items from coll while pred(item) returns true.

Latest version **3.0.0** (published 2020-03-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install take-while
pnpm add take-while
yarn add take-while
bun add take-while
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2020-03-28 |
| First published | 2014-03-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 10.0.0 |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Trevor Landau |
| Maintainers | landau |
| Keywords | functional, map, iterate, array, keep, transform |

## Links

- npm: https://www.npmjs.com/package/take-while
- Repository: https://github.com/landau/take-while
- Issues: https://github.com/landau/take-while/issues
- npm.io page: https://npm.io/package/take-while

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2020-03-28
- 2.0.0 — 2019-04-09
- 1.0.0 — 2014-03-27

## README

[![Build Status](https://travis-ci.org/landau/take-while.svg)](https://travis-ci.org/landau/take-while)

take-while
==========

Returns an array of successive items from coll while pred(item) returns true.

```js
function takeWhile(coll, pred, ctx) { }
```

## Install

`npm i -S take-while`

## Usage

```js
var assert = require('assert');
var takeWhile = require('take-while');
var is = require('is-predicate');

var arr = [-2, -1, 0, 1, 2, 3];
assert.deepEqual(takeWhile(arr, is.neg), [-2, -1]); // true
```

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