This is my proof of concept of queue design and demonstration on how to applied it in Javascript. It supports concurrency.
$ git clone https://github.com/tuxtong/js-queue
$ cd js-queue
# No need to run freaking `npm install` or `yarn` just run it with `node`
node index.js