Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@maildrop/api

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maildrop/api - npm Package Compare versions

Comparing version 1.0.7 to 1.0.9

9

main.js
const axios = require("axios");
const moment = require("moment");
const url = require("url");

@@ -13,4 +12,4 @@

// api key expiry
apiKeyExpiry: "1970-01-01",
// api key expiry timestamp
apiKeyExpiry: 0,

@@ -76,3 +75,3 @@ /**

async getApiKey() {
if (!this.apiKey || moment().isAfter(this.apiKeyExpiry)) {
if (!this.apiKey || this.apiKeyExpiry < new Date().getTime()) {
const { data: html } = await axios.get(this.webHost);

@@ -83,3 +82,3 @@ const { data: js } = await axios.get(

this.apiKey = js.match(/x-api-key":"([^"]+)/)[1];
this.apiKeyExpiry = moment().add(60, "minutes").toDate(); // every 1 hour renew apiKey logic
this.apiKeyExpiry = new Date().getTime() + 2 * 60 * 60 * 1000; // expired in 2 hour
}

@@ -86,0 +85,0 @@ return this.apiKey;

{
"dependencies": {
"axios": "^0.19.2",
"moment": "^2.24.0",
"url": "^0.11.0"

@@ -10,5 +9,7 @@ },

"anonymous",
"disposable-email",
"email",
"fetch",
"maildrop"
"maildrop",
"temporary-email"
],

@@ -21,3 +22,3 @@ "main": "main.js",

},
"version": "1.0.7"
"version": "1.0.9"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc