npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cnys

v1.0.0

Published

Synchronization between remote server on change !

Downloads

73

Readme

cnys Build Statusdependencies StatusdevDependencies Status

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>]

| Options | Description | aliases | type | default | | ------- | ----------------------------------------------------- | ------- | ----------------------------------------------------- | ----------------- | | verbose | Output action logs. | --v | boolean | false | | debug | Output debug logs. | --d | boolean | false | | remove | Enable delete file from destination. | --rm | boolean | true | | ignored | A glob, regex, function, or array of any combination. | --i | filePattern | null | | events | An array of event used as liteners. | --e | array | Events |

$ cyns remote [source=<sourcePath>] [url=<urlString>] [destination=<destinationpath>]

| Options | Description | aliases | type | default | | ----------- | ----------------------------------------------------- | ------- | ----------------------------------------------------- | ----------------- | | verbose | Output action logs. | --v | boolean | false | | debug | Output debug logs. | --d | boolean | false | | concurrency | Number of task that can be done in parallel. | --c | number | 5 | | remove | Enable delete file from destination. | --rm | boolean | true | | ignored | A glob, regex, function, or array of any combination. | --i | filePattern | null | | ncUrl | A netcat url for ssh. (this is your destination). | --nc | string | null | | username | A username to connect for ssh. | --u | string | null | | password | A password to connect for ssh. | --pwd | string | null | | privateKey | Will look for your pka file under ~/.ssh. | --ppk | boolean | false | | events | An array of event used as liteners. | --e | array | Events |

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.