inboxthunks

co-based inbox, inbox thunkified

Usage no npm install needed!

<script type="module">
  import inboxthunks from 'https://cdn.skypack.dev/inboxthunks';
</script>

README

inboxthunks

Thunkified imap client

Based on inbox

install

npm install inboxthunks

example

var inbox = require ('inboxthunks');
var co = require ('co');

var client = inbox.init(false, 'imap.gmail.com', {
  secureConnection: true,
  auth : {
    user : 'mail@gmail.com',
    pass : 'pass'
  }
});

co (function * (){
  // try
  yield client.connect();
  // catch the error

  // list mailboxes or other api call
  var mailboxes = yield client.listMailboxes();
  console.log (mailboxes);
  
  // try
  yield client.close();
  // catch the error
}

license

MIT