A locking library like mutexify, mutex-js, await-lock, and many more, but with more flexibility in how to use it to be both sturdier and very quick.
The term "mutex" usually refers to a data structure used to synchronize concurrent processes running on different threads. For example, before accessing a non-threadsafe resource, a thread will lock ...