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.
- Host: GitHub
- URL: https://github.com/lamansky/empty-iterator
- Owner: lamansky
- License: mit
- Created: 2018-05-14T07:49:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-14T07:50:42.000Z (about 8 years ago)
- Last Synced: 2025-08-21T03:34:34.204Z (10 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
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
```