Permalink
Browse files

support zlib data compression for list(), get(), put(), append() for …

…servers that allow it
  • Loading branch information...
1 parent f217894 commit 80658dd1a5e00b6d7c8dfa2f1fa3c764a1d59690 @mscdex committed Dec 18, 2012
Showing with 215 additions and 91 deletions.
  1. +4 −4 README.md
  2. +0 −1 TODO
  3. +211 −86 lib/ftp.js
View
@@ -118,7 +118,7 @@ Methods
### Required "standard" commands (RFC 959)
-* **list**([< _string_ >path, ]< _function_ >callback) - _(void)_ - Retrieves the directory listing of `path`. `path` defaults to the current working directory. `callback` has 2 parameters: < _Error_ >err, < _array_ >list. `list` is an array of objects with these properties:
+* **list**([< _string_ >path, ][< _boolean_ >useCompression, ]< _function_ >callback) - _(void)_ - Retrieves the directory listing of `path`. `path` defaults to the current working directory. `useCompression` defaults to false. `callback` has 2 parameters: < _Error_ >err, < _array_ >list. `list` is an array of objects with these properties:
* type - _string_ - A single character denoting the entry type: 'd' for directory, '-' for file (or 'l' for symlink on **\*NIX only**).
@@ -142,11 +142,11 @@ Methods
* target - _string_ - For symlink entries, this is the symlink's target **(*NIX only)**.
-* **get**(< _string_ >path, < _function_ >callback) - _(void)_ - Retrieves a file, `path`, from the server. `callback` has 2 parameters: < _Error_ >err, < _ReadableStream_ >fileStream.
+* **get**(< _string_ >path, [< _boolean_ >useCompression, ]< _function_ >callback) - _(void)_ - Retrieves a file, `path`, from the server. `useCompression` defaults to false. `callback` has 2 parameters: < _Error_ >err, < _ReadableStream_ >fileStream.
-* **put**(< _mixed_ >input, < _string_ >path, < _function_ >callback) - _(void)_ - Sends data to the server to be stored as `path`. `input` can be a ReadableStream, a Buffer, or a path to a file. `callback` has 1 parameter: < _Error_ >err.
+* **put**(< _mixed_ >input, < _string_ >destPath, [< _boolean_ >useCompression, ]< _function_ >callback) - _(void)_ - Sends data to the server to be stored as `path`. `input` can be a ReadableStream, a Buffer, or a path to a local file. `useCompression` defaults to false. `callback` has 1 parameter: < _Error_ >err.
-* **append**(< _mixed_ >input, < _string_ >path, < _function_ >callback) - _(void)_ - Same as **put()**, except if `path` already exists, it will be appended to instead of overwritten.
+* **append**(< _mixed_ >input, < _string_ >destPath, [< _boolean_ >useCompression, ]< _function_ >callback) - _(void)_ - Same as **put()**, except if `destPath` already exists, it will be appended to instead of overwritten.
* **rename**(< _string_ >oldPath, < _string_ >newPath, < _function_ >callback) - _(void)_ - Renames `oldPath` to `newPath` on the server. `callback` has 1 parameter: < _Error_ >err.
View
1 TODO
@@ -1,4 +1,3 @@
- Add support for some SITE commands such as CHMOD, CHGRP, and QUOTA
- Active (non-passive) data connections
- - MODE Z support
- IPv6 support
Oops, something went wrong.

0 comments on commit 80658dd

Please sign in to comment.