p-queue
p-queue copied to clipboard
PQueue has no `on` method
const queue = new PQueue({
concurrency: 10,
})
queue.on("next", async () => {console.log('next')})
throw the error:
error: Uncaught (in promise) TypeError: queue.on is not a function
The readme seems to have been taken from the node version. The on method exists on Node's EventEmitter, but in this Deno version, this has been swapped out for EventTarget which has no on method. This package should either bring in Node's EventEmitter (import { EventEmitter } from 'node:events';) or the README should be adjusted to use addEventListener instead of on.