Skip to content

Commit

Permalink
chore(readme): add file events to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
trs committed Feb 10, 2018
1 parent 40b0889 commit a468d4f
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit a468d4f

Please sign in to comment.