# live-list

> Fast linked list with live iterator

Latest version **1.0.0** (published 2014-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install live-list
pnpm add live-list
yarn add live-list
bun add live-list
```

## 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 | 2014-09-20 |
| First published | 2013-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Maximilian Antoni |
| Maintainers | mantoni |
| Keywords | list, iterator |

## Links

- npm: https://www.npmjs.com/package/live-list
- Repository: https://github.com/mantoni/live-list.js
- Issues: https://github.com/mantoni/live-list.js/issues
- npm.io page: https://npm.io/package/live-list

## Dependencies (2)

- [inherits](https://npm.io/package/inherits.md) ^2.0
- [min-iterator](https://npm.io/package/min-iterator.md) ^1.0

## Recent versions

- 1.0.0 (latest) — 2014-09-20
- 0.3.0 — 2013-12-17
- 0.2.0 — 2013-12-16
- 0.1.0 — 2013-11-23

## README

# live-list.js

[![Build Status]](https://travis-ci.org/mantoni/live-list.js)
[![SemVer]](http://semver.org)
[![License]](https://github.com/mantoni/live-list.js/blob/master/LICENSE)

Fast linked list with live iterator. The list can be modified while iterating
over the items.

## Install with npm

```
npm install live-list
```

## Browser compatibility

To use this module in a browser, download the npm package and then use
[Browserify](http://browserify.org) to create a standalone version.

## Usage

```js
var List = require('live-list').List;

var l = new List();
l.push(3);
l.unshift(1);
l.insert(2, 3);

var v, i = l.iterator();
while ((v = i.next()) !== undefined) {
  console.log(v);
}
```

## List API

- `length`: Reflects the number of items in the list
- `push(value)`: Appends a value to the list
- `unshift(value)`: Prepends a value to the list
- `insert(value, before)`: Inserts a value before another value
- `remove(value)`: Removes the given value from the list
- `removeAll()`: Removes all values from the list
- `toArray()`: Returns a new array with all values in the list
- `iterator()`: Returns a new `Iterator`

## Iterator API

The iterator is derived from [min-iterator][] and extends the API with these
functions:

- `insert(value)`: Inserts a value into the list before the value
  returned by the last call to `next()`
- `remove()`: Removes the value from the list that was returned
  by the last call to `next()`

[min-iterator]: https://github.com/mantoni/min-iterator.js

## License

MIT

[Build Status]: http://img.shields.io/travis/mantoni/live-list.js.svg
[SemVer]: http://img.shields.io/:semver-%E2%9C%93-brightgreen.svg
[License]: http://img.shields.io/npm/l/live-list.svg

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