$ luarocks install promise-dot-luaA JavaScript-style Promise library for Lua
See https://ezhik.jp/promise.lua for more information and a playground.
I tried to cover most of the API I saw on MDN.
I've kept this async runtime-agnostic. You can override the Promise.schedule(fn) function with your own implementation that will schedule functions for later asynchronous execution. An example implementation for Hammerspoon is provided in the repository.
Versions
Dependencies
lua >= 5.1