node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org »

it-works-regenerator-html

it-works-regenerator-html

HTML version of it-works-regenerator

example

Build main.js

var gen = require('it-works-regenerator-html');
var fs = require('fs');
fs.writeFileSync('./main.js', gen.js);

test.js

for(var i = 0; i < 10; i++){
  console.log(gen().next());
}
console.log(gen('done').next());

index.html

<html>
  <head>
    <title>it-works-regenerator-html</title>
  </head>
  <body>
    <h1>
      Please view the result in JavaScript console
    </h1>
    <script src="main.js"></script> 
    <script src="test.js"></script> 
  </body>
</html>