![]() System(callback) - (void) - Retrieves the server's operating system. Pwd(callback) - (void) - Retrieves the current working directory. callback has 1 parameter: err.Ĭdup(callback) - (void) - Changes the working directory to the parent of the current directory. If recursive, this call will delete the contents of the directory if it is not empty. Rmdir(path, callback) - (void) - Removes a directory, path, on the server. recursive is for enabling a 'mkdir -p' algorithm and defaults to false. Mkdir(path, callback) - (void) - Creates a new directory, path, on the server. callback has 1 parameter: err.īinary(callback) - (void) - Sets the transfer data type to binary (default at time of connection). callback has 2 parameters: err, status.Īscii(callback) - (void) - Sets the transfer data type to ASCII. Status(callback) - (void) - Retrieves human-readable information about the server's status. callback has 3 parameters: err, responseText, responseCode. Site(command, callback) - (void) - Sends command (e.g. Note: currentDir is only given if the server replies with the path in the response text.Ībort(callback) - (void) - Aborts the current data transfer (e.g. callback has 2 parameters: err, currentDir. callback has 1 parameter: err.Ĭwd(path, callback) - (void) - Changes the current working directory to path. callback has 1 parameter: err.ĭelete(path, callback) - (void) - Deletes a file, path, on the server. Logout(callback) - (void) - Logout the user from the server. Rename(oldPath, newPath, callback) - (void) - Renames oldPath to newPath on the server. callback has 1 parameter: err.Īppend(input, destPath, callback) - (void) - Same as put(), except if destPath already exists, it will be appended to instead of overwritten. input can be a ReadableStream, a Buffer, or a path to a local file. Put(input, destPath, callback) - (void) - Sends data to the server to be stored as destPath. callback has 2 parameters: err, fileStream. Get(path, callback) - (void) - Retrieves a file at path from the server. * sticky - _boolean_ - True if the sticky bit is set for this entry **(*NIX only)**. * target - _string_ - For symlink entries, this is the symlink's target **(*NIX only)**. * group - _string_ - The group name or ID that this entry belongs to **(*NIX only)**. * owner - _string_ - The user name or ID that this entry belongs to **(*NIX only)**. ![]() * other - _string_ - An empty string or any combination of 'r', 'w', 'x'. * group - _string_ - An empty string or any combination of 'r', 'w', 'x'. * user - _string_ - An empty string or any combination of 'r', 'w', 'x'. * rights - _object_ - The various permissions for this entry **(*NIX only)**. * date - _Date_ - The last modified date of the entry. * size - _string_ - The size of the entry in bytes. * name - _string_ - The name of the entry. 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**). path defaults to the current working directory. List(callback) - (void) - Retrieves the directory listing of path. Default: 10000Įnd() - (void) - Closes the connection to the server after any/all enqueued commands have been executed.ĭestroy() - (void) - Closes the connection to the server immediately. Keepalive - integer - How often (in milliseconds) to send a 'dummy' (NOOP) command to keep the connection alive. PasvTimeout - integer - How long (in milliseconds) to wait for a PASV data connection to be established. Default: - integer - How long (in milliseconds) to wait for the control connection to be established. Password - string - Password for authentication. User - string - Username for authentication. SecureOptions - object - Additional options to be passed to tls.connect(). Secure - mixed - Set to true for both control and data connection encryption, 'control' for control connection encryption only, or 'implicit' for implicitly encrypted control connection (this mode is deprecated in modern times, but usually uses port 990) Default: false Port - integer - The port of the FTP server. Host - string - The hostname or IP address of the FTP server. (constructor)() - Creates and returns a new FTP client instance.Ĭonnect(config) - (void) - Connects to an FTP server. * Note: As with the 'error' event, any error objects passed to callbacks will have a 'code' property for protocol-level errors. In case of protocol-level errors, err contains a 'code' property that references the related 3-digit FTP response code. Ready() - Emitted when connection and authentication were sucessful.Ĭlose(hadErr) - Emitted when the connection has fully closed.Įnd() - Emitted when the connection has ended.Įrror(err) - Emitted when an error occurs. msg is the text the server sent upon connection. Greeting(msg) - Emitted after connection.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |