# iterables-js

> Javascript iterables

Latest version **0.3.0** (published 2017-08-16) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2017-08-16 |
| First published | 2017-03-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gerard Rico Botella |
| Maintainers | gricob |
| Keywords | iterables, collection, javascript |

## Links

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

## Recent versions

- 0.3.0 (latest) — 2017-08-16
- 0.2.0 — 2017-05-08
- 0.1.5 — 2017-03-27
- 0.1.4 — 2017-03-20
- 0.1.3 — 2017-03-20
- 0.1.2 — 2017-03-20
- 0.1.1 — 2017-03-20
- 0.1.0 — 2017-03-20

## README

```typescript
//Define a class
class Example {
  constructor(
    public id: number,
    public name: string
  ){}
}

//Create a collection that identifies objects by its 'id'
let collection = new Collection<Example>('id');

//Adding a new element
let obj = new Example(1, 'Example1');
collection.add(obj);

//Adding elements array
let array = [new Example(2, 'Example2')];
collection.addElements(array);

//Get element by index
let obj = collection.get(0); //Return obj

//Get element by key
let obj = collection.getByKey('1') //Return obj

//Removing element
collection.remove(obj);

//Check if collection contains an element
collection.contains(obj);

//Get collection size
let size = collection.size();

//Iterate
for(element of collection.elements())
{
  //
}
```

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