An open API service indexing awesome lists of open source software.

https://github.com/lamansky/empty-iterator

[Node.js] Creates an iterator that finishes immediately.
https://github.com/lamansky/empty-iterator

Last synced: 3 months ago
JSON representation

[Node.js] Creates an iterator that finishes immediately.

Awesome Lists containing this project

README

          

# empty-iterator

Creates an iterator that finishes immediately.

## Installation

Requires [Node.js](https://nodejs.org/) 4.0.0 or above.

```bash
npm i empty-iterator
```

## API

The module exports a single function with no parameters. Each time it is called, it creates and returns a new empty iterator.

## Example

```javascript
const emptyIterator = require('empty-iterator')

emptyIterator().next().done // true
```