chadxz / imap-simple

Wrapper over node-imap, providing a simpler api for common use cases
MIT License
243 stars 80 forks source link

`connection.imap.closeBox(false)` does not return a Promise as expected #81

Closed ghost closed 4 years ago

ghost commented 4 years ago
index.js:156
      connection.imap.closeBox(false).catch(
                                     ^

TypeError: Cannot read property 'catch' of undefined

According to https://github.com/chadxz/imap-simple/blob/master/lib/imapSimple.js#L104 it seemed that this function should return a Promise, but the error I saw above indicated otherwise.

Package version: "imap-simple": "^5.0.0"

ghost commented 4 years ago

Outdated example. One should be calling connection.closeBox() if they expect promise. connection.imap is the underlaying node-imap instance, which does not have promise based interface.