1.0.3 • Published 2 years ago

@ankittiwaari/ftp-search v1.0.3

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

ftp-search

Introduction

This module can be used to search for a particular file using FTP protocol. Since the FTP does not offer any built-in search feature, this module simply looks in each folder recursively and returns the path of first occurrence of specified file.

It has the following limitations at present that are to be removed in subsequent updates 1. It only searches for the first occurrence of specified file.

Usage

const FTPSearch = require('@ankittiwaari/ftp-search');
(async () => {
    let ftp = new FTPSearch({
        host: '<ftp-host>',
        user: '<username>',
        password: '<password>',
        filename: '<file to search for>',
        ignoredDirs: [
            'dirname1',
            'dirname2',
        ], // list of directories to ignore
        maxRecursion: 4 // (Optional) maximum depth the search should continue. The default value is 4 
    });
    await ftp.connect();
    let path = await ftp.searchFile()
    console.log(path);
})()
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago