w-ftp 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/jsftp.js CHANGED
@@ -582,7 +582,7 @@ Ftp.prototype.put = function(from, destination, callback) {
582
582
  // })
583
583
 
584
584
  socket.on('drain', () => {
585
- console.log('drain')
585
+ // console.log('drain')
586
586
  if (from.length > pointer + SLICE) {
587
587
  newBuf = from.slice(pointer, pointer + SLICE)
588
588
  pointer += SLICE
@@ -767,11 +767,14 @@ Ftp.prototype.getPasvSocket = function(callback = NOOP) {
767
767
  */
768
768
  Ftp.prototype.ls = function(filePath, callback) {
769
769
  function entriesToList(err, entries) {
770
+ // console.log('entriesToList', err, entries)
770
771
  if (err) {
771
772
  return callback(err)
772
773
  }
773
774
 
775
+ //ListingParser.parseFtpEntries是基於parse-listing解析, 但原始數據是ls而來, 本身就沒有到秒, 故只有類似dir提供的粗略時間, 無法像fs.statSync提供精確的產生與最新變更時間
774
776
  ListingParser.parseFtpEntries(entries.text || entries, (err, files) => {
777
+ // console.log('ListingParser.parseFtpEntries', err, files)
775
778
  if (err) {
776
779
  return callback(err)
777
780
  }
@@ -790,6 +793,7 @@ Ftp.prototype.ls = function(filePath, callback) {
790
793
  }
791
794
  else {
792
795
  this.raw('stat', filePath, (err, data) => {
796
+ // console.log('filePath', filePath, data)
793
797
  // We might be connected to a server that doesn't support the
794
798
  // 'STAT' command, which is set as default. We use 'LIST' instead,
795
799
  // and we set the variable `useList` to true, to avoid extra round
@@ -14,14 +14,30 @@ rollupFiles({
14
14
  globals: {
15
15
  'path': 'path',
16
16
  'fs': 'fs',
17
- 'process': 'process',
18
- 'child_process': 'child_process',
17
+ 'net': 'net',
18
+ 'events': 'events',
19
+ 'util': 'util',
20
+ 'stream': 'stream',
21
+ 'stream-combiner': 'stream-combiner',
22
+ 'ftp-response-parser': 'ftp-response-parser',
23
+ 'parse-listing': 'parse-listing',
24
+ 'once': 'once',
25
+ 'unorm': 'unorm',
26
+ 'debug': 'debug',
19
27
  },
20
28
  external: [
21
29
  'path',
22
30
  'fs',
23
- 'process',
24
- 'child_process',
31
+ 'net',
32
+ 'events',
33
+ 'util',
34
+ 'stream',
35
+ 'stream-combiner',
36
+ 'ftp-response-parser',
37
+ 'parse-listing',
38
+ 'once',
39
+ 'unorm',
40
+ 'debug',
25
41
  ],
26
42
  })
27
43