| Server IP : 82.148.16.210 / Your IP : 216.73.216.19 Web Server : nginx/1.29.5 System : Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64 User : root ( 0) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/share/doc/node-make-generator-function/ |
Upload File : |
#make-generator-function <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
[![browser support][testling-svg]][testling-url]
Returns an arbitrary generator function, or undefined if generator syntax is unsupported.
If both generator syntax and concise method syntax are supported, the generator function returned will have a "concise" property containing a concise generator method.
## Example
```js
var maybeGeneratorFunction = require('make-generator-function');
if (maybeGeneratorFunction) {
assert(typeof maybeGeneratorFunction === 'function');
var maybeConciseGeneratorMethod = maybeGeneratorFunction.concise;
if (maybeConciseGeneratorMethod) {
assert(typeof maybeConciseGeneratorMethod === 'function');
}
} else {
assert(typeof maybeGeneratorFunction === 'undefined');
}
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/make-generator-function
[npm-version-svg]: http://versionbadg.es/ljharb/make-generator-function.svg
[travis-svg]: https://travis-ci.org/ljharb/make-generator-function.svg
[travis-url]: https://travis-ci.org/ljharb/make-generator-function
[deps-svg]: https://david-dm.org/ljharb/make-generator-function.svg
[deps-url]: https://david-dm.org/ljharb/make-generator-function
[dev-deps-svg]: https://david-dm.org/ljharb/make-generator-function/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/make-generator-function#info=devDependencies
[testling-svg]: https://ci.testling.com/ljharb/make-generator-function.png
[testling-url]: https://ci.testling.com/ljharb/make-generator-function
[npm-badge-png]: https://nodei.co/npm/make-generator-function.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/make-generator-function.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/make-generator-function.svg
[downloads-url]: http://npm-stat.com/charts.html?package=make-generator-function