1.0.0 • Published 6 years ago

cnys v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

cnys Build Statusdependencies StatusdevDependencies Status

npm.io

cnys main feature allow developers to synchronize files between remote server on change !, what it does:

  • ssh/sftp ! :globe_with_meridians:
  • Server hoping (netcat) :lock:
  • Copy/delete file/folder ! :eyeglasses:
  • Queue / concurrency :train:
  • Ready to use :fire:

If something doesn’t work, please file an issue :bug:.

Quick Start

Install

$ npm install or yarn install

Then use it like this :

const cnys = require('cnys');

const config = {
  url: '192.168.30.2',
  source: 'sync',
  destination: '/home/user/sync',
  username: 'your_username',
  privateKey: true
};

cnys(config);

Which is the same as :

$ cnys remote 'sync' '192.168.30.2' '/home/user/sync'  --username 'your_username' --privateKey true

Commands

Start cnys on a local folder to a local destination :

$ cyns local [source=<sourcePath>] [destination=<destinationpath>]
OptionsDescriptionaliasestypedefault
verboseOutput action logs.--vbooleanfalse
debugOutput debug logs.--dbooleanfalse
removeEnable delete file from destination.--rmbooleantrue
ignoredA glob, regex, function, or array of any combination.--ifilePatternnull
eventsAn array of event used as liteners.--earrayEvents
$ cyns remote [source=<sourcePath>] [url=<urlString>] [destination=<destinationpath>]
OptionsDescriptionaliasestypedefault
verboseOutput action logs.--vbooleanfalse
debugOutput debug logs.--dbooleanfalse
concurrencyNumber of task that can be done in parallel.--cnumber5
removeEnable delete file from destination.--rmbooleantrue
ignoredA glob, regex, function, or array of any combination.--ifilePatternnull
ncUrlA netcat url for ssh. (this is your destination).--ncstringnull
usernameA username to connect for ssh.--ustringnull
passwordA password to connect for ssh.--pwdstringnull
privateKeyWill look for your pka file under ~/.ssh.--ppkbooleanfalse
eventsAn array of event used as liteners.--earrayEvents

Events

You may want to look at chokidar, to see what kind of events you could start watching, by default cnys use all events.

Example of use :

$ cnys local 'sync' 'sync2' --v true --ignored '.git*' '*.yml'

The example above will start watching file on a folder name sync and copying file into folder sync2

$ cnys remote 'sync' '192.168.30.2' '/home/user/sync'  --ncUrl '192.168.30.3' --username 'your_username' --privateKey true

The example above will start watching file on a folder name sync and copying file to '192.168.30.3' at '/home/user/test'

Test

Use npm test to start testing your file. By default it read test file named *.test.js under /test.

You can easily add your own config by editing package.json

It also has a built-in coverage with npm run coverage

Credits

chokidar, a powerfull watcher

Jest, a testing framework

Thanks to Alexandre for the idea.

1.0.0

6 years ago

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

9.0.0

6 years ago

8.0.6

6 years ago

8.0.5

6 years ago

8.0.4

6 years ago

8.0.3

6 years ago

8.0.2

6 years ago

8.0.1

6 years ago

8.0.0

6 years ago

0.7.5

6 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago