# uiterator

> Really tiny iterator for arrays and objects.

Latest version **1.0.5** (published 2021-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install uiterator
pnpm add uiterator
yarn add uiterator
bun add uiterator
```

## 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.5 |
| Published | 2021-10-01 |
| First published | 2021-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniil Kirichenko |
| Maintainers | kirick |
| Keywords | uiterator, iterator, micro iterator |

## Links

- npm: https://www.npmjs.com/package/uiterator
- Repository: https://github.com/kirick13/uiterator
- Homepage: https://github.com/kirick13/uiterator#readme
- Issues: https://github.com/kirick13/uiterator/issues
- npm.io page: https://npm.io/package/uiterator

## Recent versions

- 1.0.5 (latest) — 2021-10-01
- 1.0.4 — 2021-09-29
- 1.0.3 — 2021-09-28
- 1.0.2 — 2021-09-28
- 1.0.1 — 2021-04-21
- 1.0.0 — 2021-04-21

## README

# μiterator
Really tiny iterator for arrays and objects.

## Usage
Require `iterate` function into your module.
```javascript
const { iterate } = require('uiterator');
```

Now you can iterate over:
- key/value pairs — `iterate(value)`;
- keys only — `iterate(value).keys()`;
- values only — `iterate(value).values()`.

### Array examples
```javascript
const test_array = [ 'foo', 'bar', 123 ];
for (const [ index, value ] of iterate(test_array)) {
  // 0, 'foo'
  // 1, 'bar'
  // 2, 123
}
for (const index of iterate(test_array).keys()) {
  // 0
  // 1
  // 2
}
```
(There is no need to iterate array values using `uiterator`.)

### Object examples
```javascript
const test_object = {
  foo: 'bar',
  baz: 123,
};
for (const [ key, value ] of iterate(test_object)) {
  // 'foo', 'bar'
  // 'baz', 123
}
for (const key of iterate(test_object).keys()) {
  // 'foo'
  // 'baz'
}
for (const value of iterate(test_object).values()) {
  // 'bar'
  // 123
}
```

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