From a468d4ffd0461da0da91b58126c4c30b3e510d39 Mon Sep 17 00:00:00 2001 From: Tyler Stewart Date: Thu, 8 Feb 2018 10:59:25 -0700 Subject: [PATCH] chore(readme): add file events to docs --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 405d9313..3f2f238e 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ The `FtpSrv` class extends the [node net.Server](https://nodejs.org/api/net.html ### `login` ```js -on('login', {connection, username, password}, resolve, reject) => { ... } +on('login', ({connection, username, password}, resolve, reject) => { ... }); ``` Occurs when a client is attempting to login. Here you can resolve the login request by username and password. @@ -152,7 +152,7 @@ Occurs when a client is attempting to login. Here you can resolve the login requ ### `client-error` ```js -on('client-error', {connection, context, error}) => { ... } +on('client-error', ({connection, context, error}) => { ... }); ``` Occurs when an error arises in the client connection. @@ -161,6 +161,26 @@ Occurs when an error arises in the client connection. `context` string of where the error occured `error` error object +### `RETR` +```js +on('RETR', (error, filePath) => { ... }); +``` + +Occurs when a file is downloaded. + +`error` if successful, will be `null` +`filePath` location to which file was downloaded + +### `STOR` +```js +on('STOR', (error, fileName) => { ... }); +``` + +Occurs when a file is uploaded. + +`error` if successful, will be `null` +`fileName` name of the file that was downloaded + ## Supported Commands See the [command registry](src/commands/registration) for a list of all implemented FTP commands.