# feathers-iterate

> Adds a .iterate() method to services in Feathers.js

Latest version **1.0.1** (published 2020-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install feathers-iterate
pnpm add feathers-iterate
yarn add feathers-iterate
bun add feathers-iterate
```

## 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.1 |
| Published | 2020-09-16 |
| First published | 2020-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ashwath Nadahalli |
| Maintainers | anadahalli |
| Keywords | feathers, feathersjs, feathers-plugins, feathers-mixins, iterate, paginate, generator |

## Links

- npm: https://www.npmjs.com/package/feathers-iterate
- Repository: https://github.com/anadahalli/feathers-iterate
- npm.io page: https://npm.io/package/feathers-iterate

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-09-16
- 1.0.0 — 2020-03-26

## README

# feathers-iterate
Adds a `.iterate()` method to services in [Feathers.js](https://feathersjs.com/)

`.iterate()` creates an async [genarator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator) for the **find** method on the service using given *params* which can be iterated using [for await...of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of)

## Install
```bash
npm install feathers-iterate --save
```
or
```bash
yarn add feathers-iterate
```

Configure on server and client

```javascript
const iterate = require('feathers-iterate')

app.configure(itereate())
```

Note: you must configure *feathers-iterate* **before** any services are registered.

## Use
```javascript
const genrator = app.service('messages').iterate({/* params */})

for await (let message of generator) {
  // do something with data
}
```

For pagination `iterate` uses `params.query.$skip` and `params.query.$limit`.

Next page is called when `total > $limit + $skip` with new skip as `$limit + $skip`.

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