var db = require('../db.js'); var users = require('./users.js'); let u = { username: "nikatlas", password: "mafalda", email: "wtf@test.g" } users.register(u).then(console.log). catch((e) => { if(e.name === "UsernameExists"){ console.log("Username exists register is bypassed!"); } }); users.login(u).then(console.log). catch((e) => { console.log(e); });