Glassfiber

Glassfiber is an intuitive Javascript co-routine library implemented
using Promises.
Requirements
It runs inside any webbrowser or NodeJS environment supporting at least
ECMAScript ES2018.
Minified and gzip-compressed, it is less than 1 KB of code.
It has zero dependencies on other modules.
Basic usage
Reference documentation
API
Specified parameters:
priority
is an optional priority
Can be 0, 1, 2 or 3 (defaults to 0 if omitted).ms
delay in milliseconds
Exposed API-list (in NodeJS and the browser):
Glassfiber.yield(priority?)
Give other coroutines a chance to run, specifying our own priority (lower
numbers are more important). Returns a Promise.Glassfiber.sleep(ms)
Sleeps for this many milliseconds, returns a Promise.
References
Card-carrying member of the zerodeps
movement.