# Generator Support
> Detect native [`generator function`][generator-function] support.
## Usage
```javascript
var hasGeneratorSupport = require( '@stdlib/assert/has-generator-support' );
```
#### hasGeneratorSupport()
Detects if a runtime environment supports ES2015 [`generator functions`][generator-function], i.e. `function*()`.
```javascript
var bool = hasGeneratorSupport();
// returns
```
## Notes
- The implementation uses code evaluation, which may be problematic in browser contexts enforcing a strict [content security policy][mdn-csp] (CSP).
## Examples
```javascript
var hasGeneratorSupport = require( '@stdlib/assert/has-generator-support' );
var bool = hasGeneratorSupport();
if ( bool ) {
console.log( 'Environment has native generator function support.' );
} else {
console.log( 'Environment lacks native generator function support.' );
}
```
* * *
## CLI
### Usage
```text
Usage: has-generator-support [options]
Options:
-h, --help Print this message.
-V, --version Print the package version.
```
### Examples
```bash
$ has-generator-support
```
[generator-function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*
[mdn-csp]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP