sergi/jsftp

Event for successful connection?

Closed this issue · 2 comments

I know I can use ftp.on('error', function (err) { //... } ) to know when the connection initialization has encountered an error. But how do I know when the connection is successful?

I've tried 'ready' because I assumed it was like the ssh2 library, but that didn't work. I know the 'data' event will tell me, but I don't want that because that will also be called anytime there is new data. I only want to know when the connection has been successfully initialized.

Nevermind, I found it looking through the code. The event is 'connect'. Are all the events document somewhere? If so, it wasn't obvious where to find it.

sergi commented

Good point @lynchs61, I'll make sure to improve the docs. Thanks!