mileszim / tempmail.js

Javascript wrapper for api.temp-mail.ru
MIT License
13 stars 7 forks source link

TypeError: TempMail is not a constructor #105

Open SajjanKarn opened 3 years ago

SajjanKarn commented 3 years ago

whenever i try to initialize an object i am getting a error

TypeError: TempMail is not a constructor

anonghuser commented 1 year ago

Despite the claim and example in the README, the webpack version of this module (0.3.x, from 5 years ago) has never worked in a browser. Versions 0.2.x seem to have been a mess as well, the constructor was the weird tempmail.default and required a fetchJsonp global for whatever reason. Versions 0.1.x seem to have worked with the constructor name in lowercase, i.e. new tempmail() but used callbacks instead of promises and http instead of https api endpoint so is mostly unusable today.

EDIT: There are other weird things in the code of the newest version as well, i.e. instead of an md5 of the address it uses the first 16 digits of a simple concatenation of ascii codes, which makes me think it never worked in node too. I'm not about to waste time testing it though.