mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 244 forks source link

[Doubt] list of files/folders of FTP SERVER #281

Closed GabrielRCL closed 2 years ago

GabrielRCL commented 2 years ago

is there any way to choose the directory that will be listed? the current code returns the files/folders I have in the "root" directory I would like to return in the console.log the files that are inside the folder "root/myFolder/"

var Client = require('ftp');

  var c = new Client();
  c.on('ready', function() {
    c.list(function(err, list) {
      if (err) throw err;
      console.dir(list);
      c.end();
    });
  });
  // connect to localhost:21 as anonymous
  c.connect();