node-global-listener
Version:
A lightweight and efficient Node.js package for capturing global keyboard and mouse events, supporting key presses, mouse movements, input simulation, and background operation.
30 lines (29 loc) • 583 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Queue {
constructor() {
this.items = [];
}
enqueue(element) {
this.items.push(element);
}
dequeue() {
if (this.isEmpty()) {
return null;
}
return this.items.shift();
}
isEmpty() {
return this.items.length === 0;
}
peek() {
if (this.isEmpty()) {
return null;
}
return this.items[0];
}
size() {
return this.items.length;
}
}
exports.default = Queue;