/nsync

nsync is library for synchronizing your files to remote server built just with Node.js API, so it's zero-dependency library.

Primary LanguageJavaScript

🚀 nsync

nsync is library for synchronizing your files to remote server built just with Node.js API, so it's zero-dependency library.

nsync implements own TCP protocol for file transfer because firstly I wanted to just play with the Node.js Socket API and secondly I wanted to use some lightweight protocol, so why not to implement my own.


🔍 Content


📑 Documentation

Basic usage

This example shows how to run basic server and client that sends single file to the server.

Server (server.js)

const nsync = new (require('./nsync'))('127.0.0.1', '6666', { server: true });

nsync.start();

Client (client.js)

const nsync = new (require('./nsync'))('127.0.0.1', '6666', { server: false });

nsync.connect()
  .then(() => {
    
    nsync.sendFile(`${__dirname}/data/text_sample.txt`)
      .then(() => {
        nsync.disconnect();
      });
  
  });

📝 Todo

  • Add upload of single file (finished)

  • Add option for uploading whole directory

  • Add unit tests for the library

  • Add option for reading server & client settings from configuration file

  • Add support for auto-sync files

  • Add support for SSL encryption

  • Add support for Gzip compression

  • Create Graphical Interface (GUI)