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

cynch

v0.0.2

Published

Asynchronous synchronization in a cinch. Multi-target file uploading with rsync!

Downloads

5

Readme

Cynch

Asynchronous synchronization in a cinch. Multi-target file uploading with rsync!

Note: Cynch takes advantage of several ES6 features (classes, arrow functions, etc). You may need to run Node with Harmony flags (or upgrade to a newer version).

What is this?

Certain IDEs (I won't name any) have pretty lame remote development support, especially if you have a need to sync with multiple remote environments. Cynch fixes that. Just specify your source and target(s) and you're ready to go.

Installation

npm install -g cynch

Usage

cynch /path/to/my/config.json

If no config file is provided, Cynch will look for cynch.json in the current working directory.

Configuration

The following are possible configuration values.

Name | Required? | Type | Description ---- | --------- | ---- | ----------- source | x | string | Source directory to sync. May be relative to the configuration path. targets | x | string[] | Target objects (see below) exclusions | | string[] | Patterns to exclude from the sync (equivalent to passing --exclude options to rsync) inclusions | | string[] | Patterns to include in the sync (equivalent to passing --include options to rsync) rsyncOptions | | string[] | Any additional options to pass to rsync watch | | boolean | Enable watch mode, watch for file changes and trigger sync watchOptions | | object | Watcher Options, See Chokidar watchOptions.waitTimeout | | int | Number of milliseconds to wait for all file change events to finish (default: 300) watchOptions.path | | string | Path to watch for changes (default: source from config file) debug | | boolean | Debug mode growl | | boolean | Allow Growl Notifications (default: true)

Target objects

Tip: rsync uses your machine's ssh config; you may substitute full user@host strings with an entry from your ssh config. (e.g.: "host": "mybox")

{
  "host": "[email protected]",
  "path": "/some/example/deployment/path"
}

Example config

{
  "source": "~/src/myProject",
  "targets": [
    {
      "host": "pinky",
      "path": "/srv/myProject"
    },
    {
      "host": "jewel",
      "path": "/srv/myProject"
    },
    {
      "host": "arvinne",
      "path": "/srv/myProject"
    }
  ],
  "exclusions": [
    ".git",
    ".idea",
    "node_modules/*"
  ]
}

Watch Mode

If watch mode is enabled, Cynch will function as a long-running process that watches for file changes and synchronizes accordingly (as opposed to exiting immediately once the sync is complete). This can be used with any daemon tool (i.e. launchd, systemd) to ease deployment.

By default, your source directory is watched. If this is not preferable, you may specify the watch directory via watchOptions.path.

Growl Notifications

With growl notifications, you can not get notified when Cynch succesffully uploads or errors out. In order for notifications to work you will need to install a notifier library.

Mac OSX (Darwin)

Install growlnotify(1). On OS X 10.8, Notification Center is supported using terminal-notifier. To install:

  $ sudo gem install terminal-notifier

Ubuntu (Linux)

Install notify-send through the libnotify-bin package:

  $ sudo apt-get install libnotify-bin

Windows

Download and install Growl for Windows

Download growlnotify - IMPORTANT : Unpack growlnotify to a folder that is present in your path!

Special Considerations

Windows

Cynch can be used on Windows using rsync from Cygwin, however there are some special requirements.

  • Cygwin's rsync does not seem to like Windows-style paths (e.g. c:\src\myProject); attempting to use them will result in error messages from rsync such as The source and destination cannot both be remote. To fix this, use Cygwin-style paths (e.g. /cygdrive/c/src/myProject). HOWEVER...
  • The file watcher does not like Cygwin-style paths. Therefore, the watchOptions.path config option must be set to the respective Windows-style path (e.g. c:\src\myProject).

##License ISC