activate venv in mac
source venv/bin/activate
environment modules macos
(() => {
'use strict';
class EventEmitter {
constructor() {
this.events = new Map();
}
on(event, listener) {
if (typeof listener !== 'function') {
throw new TypeError('The listener must be a function');
}
let listeners = this.events.get(event);
if (!listeners) {
listeners = new Set();
this.events.set(event, listeners);
}
listeners.add(listener);
return this;
}
off(event, listener) {
if (!arguments.length) {
this.events.clear();
} else if (arguments.length === 1) {
this.events.delete(event);
} else {
const listeners = this.events.get(event);
if (listeners) {
listeners.delete(listener);
}
}
return this;
}
emit(event, ...args) {
const listeners = this.events.get(event);
if (listeners) {
for (let listener of listeners) {
listener.apply(this, args);
}
}
return this;
}
}
this.EventEmitter = EventEmitter;
})();
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us