You can clone with
HTTPS or Subversion.
If the connection hasn't yet been opened, a close() returns no error but does nothing...that's not good. I've got a pull that should fix this by adding a client.close() after all the pended requests flush.
(The use case here is when running a production cron job or shorter script that logs via winston with mongodb transport...the scripts can exit quickly but when winston-mongodb is set to keepAlive:true, the script cleanup routine, which calls close(), returns but the script never actually exits)
Add close after flush when connection state == 'opening'. Closes #13.