https://blog.meteor.com/using-promises-and-async-await-in-meteor-8f6f4a04f998 async lol(){ const data = await urlMetadata('https://www.vayuz.com/').then( function (metadata) { // success handler console.log(metadata); return metadata; }, function (error) { // failure handler console.log(error) return error; }).then( function(success){ UserInfo.rawCollection().insert({"data":success}); return success; },function(error){ console.log("log"); }) return data; },