node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…

co-inbox

Better inbox api based on <a href="https://github.com/visionmedia/co">visionmedia/co</a> and <a href="https://github.com/andris9/inbox">andris9/inbox</a>

co-inbox

Better inbox api based on visionmedia/co and andris9/inbox

$ npm install co-inbox
const inbox = Object.create(Inboxes);
const client = yield inbox.createConnection(false, 'imap.gmail.com', {
  secureConnection: true,
  auth: {
    user: 'yorkiefixer@gmail.com',
    pass: 'xxxxxxxxx'
  },
  debug: true
});
 
const mailboxes = yield inbox.listMailboxes();
console.log(mailboxes);
 
// use unsupported function from upstream 
inbox.client.createMessageStream(32)
  .pipe(process.stdout, {end: false});
 
// close 
inbox.close();

NB: for more infomation on API, you could visit andris9/inbox

  • createConnection(port, host, option)

  • listMailboxes()

  • getMailbox(path)

  • openMailbox(path)

  • listMessages(from, limit)

  • listMessagesByUID(first, last)

  • listFlags(from, limit)

  • search(query, isUID)

  • fetchData(uid)

  • fetchFlags(uid)

  • addFlags(uid, flags)

  • removeFlags(uid, flags)

  • storeMessage(message, flags)

  • copyMessage(uid, destination)

  • moveMessage(uid, destination)

  • deleteMessage(uid)

MIT