/sync.folder

sync directories over socket

Primary LanguageJavaScriptMIT LicenseMIT

Intro

GitHub Actions status | linter GitHub Actions status | publish GitHub Actions status | test

A tool to sync directories on a remote server

Install

use in project

npm install --save git+https://github.com/anzerr/sync.folder.git
npm install --save @anzerr/sync.folder

add command

git clone git+https://git@github.com/anzerr/sync.folder.git &&
cd sync.folder &&
npm link

docker

docker run --restart always --name sync -v $(pwd):/cwd -p 3000:3000 -p 3001:3001 -u `id -u $USER` anzerr/sync.folder
syncF client --host 192.168.99.100:3000 --cwd .

Example

syncF server --host 0.0.0.0:3000 --cwd ./tmp
syncF client --host localhost:3000 --cwd ./src

syncF client --save --name "sync.json" --host 127.0.0.1:3000 --cwd ./server
syncF client --save --name "sync.json" --host 127.0.0.1:3001 --cwd ./client
syncF client --load --name "sync.json"
const sync = require('sync.folder');

let port = 5935;
new sync.Server('./tmp', 'localhost:' + port);
let client = new sync.Client('./src', 'localhost:' + port);

client.on('remove', (r) => {
	console.log('removed', r);
});

client.on('add', (r) => {
	console.log('add', r);
});