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

@rgrove/synchrotron

v2.0.1

Published

Watches a local directory and syncs files to another directory or a remote destination using rsync whenever changes occur.

Downloads

40

Readme

@rgrove/synchrotron

Watches a local directory and syncs files to another directory or a remote destination using rsync whenever changes occur.

npm version

Why You Might Want It

You have some local files. Maybe thousands of them.

When you make local changes, you want those changes to be synced immediately to another location (like a remote development server).

You want this to be fast whether you make a change to one file or to thousands of files, because sometimes you change a lot of things at once, like when you check out another git branch, or run webpack, or do a massive find and replace.

Quick Start

Install Synchrotron globally and view the available options:

npm i -g @rgrove/synchrotron
synchrotron --help

Or, if you prefer, install it locally in a project directory and run it via npm scripts or npx:

npm i @rgrove/synchrotron
npx @rgrove/synchrotron --help

If you're scared of commitment, you can skip the installation step entirely and let npx install Synchrotron on demand whenever you use it:

npx @rgrove/synchrotron --help

Requirements

  • Node.js 12+
  • Rsync 2.6.7+
  • Tested on macOS. Might work on Linux. Probably won't work on Windows.

Examples

These examples assume you've installed Synchrotron globally. If you'd prefer to run it via npx, replace the command synchrotron with npx @rgrove/synchrotron.

Sync the current working directory over SSH to the path /data/www on the server example.com and then watch for changes:

synchrotron --dest example.com:/data/www

Sync the local directory /Users/kevin to the local directory /Users/nora once and then exit without watching for changes:

synchrotron --source /Users/kevin --dest /Users/nora --once

Pretend to sync the current working directory to a remote server and watch for changes, but don't actually sync anything (this is great if you just want to see what would happen):

synchrotron --dest example.com:/data/www --dry-run

See a list of all available options:

synchrotron --help

Ignoring Files & Directories

You can use a .synchrotron-ignore file to specify file and directory names and patterns that Synchrotron should ignore.

Synchrotron will search for a .synchrotron-ignore file starting in the source directory, then its parent directory, then its parent's parent, and so on, stopping if it finds one. Or you can specify an ignore file manually with the --ignore-path option.

This file should contain a newline-separated list of rsync exclude pattern rules. The format is similar to — but not exactly the same as — the format of .gitignore files.

For example:

# Ignore a file or directory named "dist" no matter where it is in the directory
# hierarchy.
dist

# Ignore any file or directory whose name starts with "."
.*

# Ignore a file or directory named "dist", but only if it's in the root of the
# directory hierarchy.
/dist

# Ignore a file or directory named "dist", but only if it's inside a directory
# named "build" anywhere in the hierarchy.
build/dist

# Ignore a directory named "dist" as well as all of its contents.
dist/***

See the rsync man page for more details.

Contributing

PRs with bug fixes are welcome!

Please get in touch before adding new features. I'm not likely to accept feature enhancements that I won't personally use since I won't be able to maintain them.