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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rsync-slim

v1.1.0

Published

Slim wrapper around rsync

Readme

rsync-slim

Slim wrapper around rsync.
Use rsync options as on the command line.

Prerequisites

rsync needs to be installed on your machine. Or cwRsync on Windows.

Installation

npm install rsync-slim --save-dev

Usage

Basic:

var rsync = require('rsync-slim');

rsync({
  src: ['index.html', 'css', 'img'],
  dest: '[email protected]:/path/on/server',
  options: '-rtvhcz --delete --progress'
});

In a gulp task:

var rsync = require('rsync-slim');

gulp.task('deploy', function() {
  var secrets = require('./secrets.json');

  rsync({
    src: 'build',
    dest: secrets.rsync.dest,
    options: '-rtvhcz --delete --progress',
    ssh: 'authFile',
    log: require('gulp-util').log
  });
});

with a file secrets.json like:

{
  "rsync": { "dest": "[email protected]:/path/on/server" }
}

which you can keep private by adding a line secrets.json to the file .gitignore.

Variations:

rsync({
  ....
  log: true,   // Will use console.log for logging.
  sync: false  // Launches rsync in async process; script doesn't wait.
},
  function(err) {  // Custom callback function.
    console.log(err);
  }
);

API

rsync(settings, callback) :

  • settings :

    • src (Array|String), required :
      an array or space-separated string of source files and folders.

    • dest (String), required :
      the destination server+path.

    • options (Object) :
      the raw rsync-command options.

    • log (Boolean|Function) :
      If true, the generated rsync-command will be sent to console.log.
      If it is a function, then it will be called with this command as String argument.

    • sync (Boolean), default=true :
      Tells whether to launch rsync synchronously (true) and wait for it to finish,
      or in an asynchronous process (false).

    • stdio (String|Array), default='inherit' :
      The child process's input/output configuration. Is passed on as stdio option to child_process.spawn/spawnSync.

    • ssh (String), default='' :
      If not empty then an option -e "ssh -i <sshAuthFile>" is generated.
      If only a filename without path, then the user's home folder + '/.ssh' is prepended (works on Window and *nix).
      On Windows, paths like C:\Users\x\.ssh\sshAuthFile are converted to cwRsync-compatible cygwin filepaths, e.g. /cygdrive/c/Users/x/.ssh/sshAuthFile.

  • callback(err) :

    is called when rsync finishes. err is null on success, else an Error object.

    If no callback is given and rsync finishes with an error, then an Error object is thrown instead.

Tips

  • For Windows clients using cwRsync:

    Create a batch-file rsync.bat that sets cwRsync's required environment-variables, and put it in a location included in your PATH:

    @echo off
    setlocal
    set RSYNC_HOME=%PROGRAMFILES%\cwRsync
    set HOME=%USERPROFILE%
    set PATH=%RSYNC_HOME%;%PATH%
    rsync %*
  • cwRsync accepts absolute paths like /cygdrive/c/path/to/source instead of C:\path\to\source.