Socket
Socket
Sign inDemoInstall

tempmail.js

Package Overview
Dependencies
9
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.3.0

dist/tempmail.node.js

6

bower.json
{
"name": "tempmail.js",
"main": "dist/tempmail.js",
"version": "0.2.1",
"main": "dist/tempmail.min.js",
"version": "0.3.0",
"homepage": "https://github.com/mileszim/tempmail.js",
"authors": [
"Miles Zimmerman <miles@zserver.org>"
"Miles Zimmerman <milezim@protonmail.com>"
],

@@ -9,0 +9,0 @@ "description": "Programatically generate and receive mail from temporary email addresses. Works in browsers and in node.js.",

{
"name": "tempmail.js",
"version": "0.2.1",
"version": "0.3.0",
"description": "Programatically generate and receive mail from temporary email addresses. Works in browsers and in node.js.",
"main": "dist/tempmail-node.js",
"main": "dist/tempmail.node.js",
"scripts": {
"build": "BABEL_ENV=node node_modules/.bin/webpack",
"clean": "rm dist/*",
"test": "echo \"Error: no test specified\" && exit 1"

@@ -28,20 +30,15 @@ },

"dependencies": {
"blueimp-md5": "^2.3.0",
"fetch-jsonp": "^1.0.0",
"isomorphic-fetch": "^2.2.1",
"babel-polyfill": "^6.7.2"
"chance": "^1.0.13",
"fetch-jsonp": "^1.1.3",
"isomorphic-fetch": "^2.2.1"
},
"devDependencies": {
"babel-plugin-syntax-async-functions": "^6.5.0",
"babel-plugin-transform-regenerator": "^6.6.5",
"babel-preset-es2015": "^6.6.0",
"babel-preset-es2015-rollup": "^1.1.1",
"babelify": "^7.2.0",
"grunt": "^0.4.5",
"grunt-babel": "^6.0.0",
"grunt-browserify": "^5.0.0",
"grunt-contrib-uglify": "^1.0.0",
"grunt-rollup": "^0.6.2",
"rollup-plugin-babel": "^2.4.0"
"babel-cli": "^6.0.0",
"babel-core": "^6.0.0",
"babel-loader": "^7.1.2",
"babel-minify-webpack-plugin": "^0.3.0",
"babel-preset-env": "^1.6.1",
"clean-webpack-plugin": "^0.1.18",
"webpack": "^3.10.0"
}
}

@@ -1,4 +0,1 @@

import 'babel-polyfill';
import md5 from 'blueimp-md5';
import 'isomorphic-fetch';

@@ -8,3 +5,10 @@ import 'fetch-jsonp';

import { IS_NODE } from './constants';
import { formatMessage, randomEmail, inboxURL, domainsURL, deleteMessageURL } from './utils';
import {
formatMessage,
emailId,
randomEmail,
inboxURL,
domainsURL,
deleteMessageURL
} from './utils';

@@ -19,3 +23,3 @@

this.address = address || randomEmail();
this.address_id = md5(this.address);
this.address_id = emailId(this.address);
this.fetch = IS_NODE ? fetch : fetchJsonp;

@@ -22,0 +26,0 @@ }

@@ -1,3 +0,10 @@

import md5 from 'blueimp-md5';
import { ADDRESS_DOMAINS, API_BASE, API_FORMAT, ENDPOINT_INBOX, ENDPOINT_DOMAINS, ENDPOINT_DELETE } from './constants';
import chance from 'chance';
import {
ADDRESS_DOMAINS,
API_BASE,
API_FORMAT,
ENDPOINT_INBOX,
ENDPOINT_DOMAINS,
ENDPOINT_DELETE
} from './constants';

@@ -29,4 +36,6 @@

export function randomEmail() {
var prefix = md5(Math.random() + Date() + Math.random());
var suffix = ADDRESS_DOMAINS[Math.floor(Math.random() * ADDRESS_DOMAINS.length)];
const name = chance.name({ middle_initial: true }).toLowerCase().split(' ').join('.');
const year = chance.integer({ min: 1970, max: ((new Date()).getFullYear() - 8) });
const prefix = `${name}-${year}`;
const suffix = chance.pickone(ADDRESS_DOMAINS);
return prefix + '@' + suffix;

@@ -37,2 +46,12 @@ }

/**
* Gives same ID for email address
* @returns {string} ID
*/
export function emailId(emailAddress) {
let code = emailAddress.split("").map(c => c.codePointAt(0)).join("");
return parseInt(code).toString(16).substr(2,12);
}
/**
* Assemble API url

@@ -39,0 +58,0 @@ * @param {string} endpoint

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc