emailjs-imap-client
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -6,5 +6,5 @@ 'use strict'; | ||
var BrowserBox = require('../src/browserbox.js'); | ||
var ImapClient = require('../src/emailjs-imap-client.js'); | ||
var connection = new BrowserBox('imap.gmail.com', 993, { | ||
var client = new ImapClient('imap.gmail.com', 993, { | ||
useSecureTransport: true, | ||
@@ -18,16 +18,12 @@ auth: { | ||
connection.onerror = function(err) { | ||
client.onerror = function(err) { | ||
console.log(err); | ||
}; | ||
connection.onauth = function() { | ||
setTimeout(function() { | ||
connection.listMailboxes(function(err, mailboxes) { | ||
setTimeout(function() { | ||
connection.close(); | ||
}, 3000); | ||
}); | ||
}, 3000); | ||
}; | ||
connection.connect(); | ||
client.connect().then(() => { | ||
client.listMailboxes().then((mailboxes) => { | ||
console.log(mailboxes); | ||
}).then(() => { | ||
client.logout(); | ||
}); | ||
}); |
{ | ||
"name": "emailjs-imap-client", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"homepage": "https://github.com/emailjs/emailjs-imap-client", | ||
@@ -5,0 +5,0 @@ "description": "JavaScript IMAP client", |
# emailjs-imap-client | ||
IMAP client written with ES2015 (ES6). | ||
IMAP client library written with ES2015 (ES6). | ||
@@ -5,0 +5,0 @@ [![Build Status](https://travis-ci.org/emailjs/emailjs-imap-client.png?branch=master)](https://travis-ci.org/emailjs/emailjs-imap-client) |
@@ -25,3 +25,3 @@ // Copyright (c) 2014 Andris Reinman | ||
if (typeof define === 'function' && define.amd) { | ||
define(['emailjs-imap-client-pako'], factory); | ||
define(['./emailjs-imap-client-pako'], factory); | ||
} else if (typeof exports === 'object') { | ||
@@ -28,0 +28,0 @@ module.exports = factory(require('./emailjs-imap-client-pako')); |
@@ -5,3 +5,3 @@ (function(root, factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
define(['emailjs-tcp-socket', 'emailjs-imap-handler', 'emailjs-mime-codec', 'emailjs-imap-client-compression'], factory); | ||
define(['emailjs-tcp-socket', 'emailjs-imap-handler', 'emailjs-mime-codec', './emailjs-imap-client-compression'], factory); | ||
} else if (typeof exports === 'object') { | ||
@@ -132,3 +132,9 @@ module.exports = factory(require('emailjs-tcp-socket'), require('emailjs-imap-handler'), require('emailjs-mime-codec'), require('./emailjs-imap-client-compression'), null); | ||
this.socket.onclose = () => this._onError(new Error('Socket closed unexceptedly!')); | ||
this.socket.ondata = (evt) => this._onData(evt); | ||
this.socket.ondata = (evt) => { | ||
try { | ||
this._onData(evt); | ||
} catch (err) { | ||
this._onError(err); | ||
} | ||
}; | ||
@@ -135,0 +141,0 @@ // if an error happens during create time, reject the promise |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
551952
13777