emailjs / emailjs-imap-client

Low-level JS IMAP client for all your IMAP needs.
MIT License
553 stars 122 forks source link

Include instructions for using as CommonJS module #208

Closed heralden closed 5 years ago

heralden commented 5 years ago

I was in the process of creating an issue until I found https://github.com/emailjs/emailjs-imap-client/issues/182, which mentions that you have to add .default when using require as from vanilla Node.js. (without .default it would just throw TypeError: ImapClient is not a constructor)

I'm not used to the semantic of adding .default when translating an ES6 import to CommonJS, (I can't remember having to do it before) so I had troubles getting this to work with Node.js. How about adding this line to the README to make it easier for people not familiar with CommonJS module semantics?