co-timer

Generator based timeout

Usage no npm install needed!

<script type="module">
  import coTimer from 'https://cdn.skypack.dev/co-timer';
</script>

README

This is a small generated based timer library. It allows you to yield to wait for a timeout. If you want to learn about generators, see the article Working with Koa and Generators.

Installation

$ npm install co-timer

Usage

co(function* () {
  yield timer(3000);
})();

License

MIT