O
O
Oleg2020-09-28 15:00:05
Node.js
Oleg, 2020-09-28 15:00:05

How can NodeJS access a file on a remote machine for processing by the Tail module?

A question.
Scripts are now running and constantly reading the file by the Tail module

const tail = new Tail(LOG_LOCATION, {
        useWatchFile: true
    });

    tail.on("line", (data) => {
        logsQueue.push(getLog(data));
        treatLogs();
    }).on("error", function(error) {
        console.log('Ошибочка при чтении файлика: ', error);
    });

Now LOG_LOCATION is the path to the folder with the file. But now the script will go to an external VDS.
Can I replace it, roughly speaking, with FTP?
Or maybe there is some ready-made solution (module) for this task.

For any advice, thanks!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question