https://github.com/parro-it/is-async-iterable
Checks if a given object is async iterable.
https://github.com/parro-it/is-async-iterable
Last synced: 10 months ago
JSON representation
Checks if a given object is async iterable.
- Host: GitHub
- URL: https://github.com/parro-it/is-async-iterable
- Owner: parro-it
- License: mit
- Created: 2017-11-18T10:45:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-28T18:27:30.000Z (about 8 years ago)
- Last Synced: 2025-03-22T13:02:37.644Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 218 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# is-async-iterable
[](http://travis-ci.org/parro-it/is-async-iterable)
[](https://npmjs.org/package/is-async-iterable)
> Checks if a given object is async iterable.
## Async iterable fun
**This module is part of
[Async iterable fun](https://github.com/parro-it/ai-fun), a complete toolset of
modules to work with async iterables.**
## Usage
**Check some objects:**
```js
const isAsyncIterable = require("is-async-iterable");
async function iter* () {
yield 1;
yield 2;
}
console.log(isAsyncIterable(iter));
console.log(isAsyncIterable(42));
```
This will output
true
false
## API
### isAsyncIterable
Return true if the argument is async iterable
**Parameters**
- `val` **any** value to check
Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if the value is async iterable
## Install
With [npm](https://npmjs.org/) installed, run
```bash
npm install --save is-async-iterable
```
## See Also
- [`noffle/common-readme`](https://github.com/noffle/common-readme)
- [`parro-it/ai-fun`](https://github.com/parro-it/ai-fun)
## License
MIT