File 1:
class Client {
constructor() {
this.login = (token) => {
this.emit("ready", this)
}
}
}
module.exports.Client = Client;
file 2:
let xx = require("file_dir")
let client = new xx.Client();
client.on("ready", () => console.log("ready"))
client.login("blah")
I get 2 errors, client.on
is not a functionand
this.emit is not a function`