GithubHelp home page GithubHelp logo

wertha / ftp-tail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thomas-smyth/ftp-tail

0.0 0.0 1.0 45 KB

Need to tail a file on a remote server? ftp-tail should be able to help!

License: MIT License

JavaScript 99.14% Shell 0.86%

ftp-tail's Introduction

ftp-tail

GitHub release GitHub contributors GitHub release


GitHub issues GitHub pull requests GitHub issues

About

Need to tail a file on a remote server? ftp-tail should be able to help!

Motivation

To collect the data we needed to build SquadJS, a scripting framework for Squad servers, we found we needed to tail the Squad server's log files. As a result of this, it became a requirement that SquadJS must be installed on the same machine as the Squad server, however, this prevented anyone using rented Squad server instances from using SquadJS. Thus, we endeavoured to make it possible for these logs files to be streamed over the FTP servers provided by most hosts - ftp-tail is the outcome of this and we have opened-sourced it for others to benefit from.

Usage

import FTPTail from 'ftp-tail';

(async () => {
  // Initiate FTPTail...
  const tailer = new FTPTail(
    {
      ftp: {
        // basic-ftp's .access options.
        host: "xxx.xxx.xxx.xxx",
        user: "user",
        password: "password",
        
        // As well as...
        timeout: 5 * 1000, // Timeout (optional).
        encoding: 'utf8' // Encoding (optional).
      },

      mode: 'ftp' // Supports ftp and sftp
      fetchInterval: 0, // Delay between polls.
      log: true // Enable logging (also accepts logging function).
    }
  );

  // Do something with the lines, e.g. log them.
  tailer.on('line', console.log);

  // Watch the file...
  await tailer.watch('/SquadGame.log');
  
  // Unwatch the file...
  await tailer.unwatch();
})();

Credits

The logic behind ftp-tail was originally proposed, designed and implemented by awn.gg - ftp-tail is an open-sourced re-implementation of their efforts.

ftp-tail's People

Contributors

tuokri avatar thomas-smyth avatar wertha avatar

Forkers

lautaro-l

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.